3.2.56-rc1 review
Subsystems (3)
PATCH 164/200 net: unix socket code abuses csum_partial
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit 0a13404dd3bf4ea870e3d96270b5a382edca85c0 upstream.
The unix socket code is using the result of csum_partial to hash into a lookup table:
unix_hash_fold(csum_partial(sunaddr, len, 0));
csum_partial is only guaranteed to produce something that can be folded into a checksum, as its prototype explains:
* returns a 32-bit number suitable for feeding into itself
* or csum_tcpudp_magic
The 32bit value should not be used directly.
Depending on the alignment, the ppc64 csum_partial will return different 32bit partial checksums that will fold into the same 16bit checksum.
This difference causes the following testcase (courtesy of Gustavo) to sometimes fail:
#include <sys/socket.h>
#include <stdio.h>
int main()
{
int fd = socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0);
int i = 1;
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &i, 4);
struct sockaddr addr;
addr.sa_family = AF_LOCAL;
bind(fd, &addr, 2);
listen(fd, 128);
struct sockaddr_storage ss;
socklen_t sslen = (socklen_t)sizeof(ss);
getsockname(fd, (struct sockaddr*)&ss, &sslen);
fd = socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0);
if (connect(fd, (struct sockaddr*)&ss, sslen) == -1){
perror(NULL);
return 1;
}
printf("OK\n");
return 0;
}As suggested by davem, fix this by using csum_fold to fold the partial 32bit checksum into a 16bit checksum before using it.
---
net/unix/af_unix.c +2 -2
@@ -149,8 +149,8 @@ static inline void unix_set_secdata(strustatic inline unsigned unix_hash_fold (__wsum n) { -unsigned hash = (__force unsigned )n; - hash ^= hash>>16 ; +unsigned int hash = (__force unsigned int )csum_fold (n); + hash ^= hash>>8 ;return hash&(UNIX_HASH_SIZE -1 ); }
PATCH 165/200 powerpc: Align p_dyn, p_rela and p_st symbols
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit a5b2cf5b1af424ee3dd9e3ce6d5cea18cb927e67 upstream.
The 64bit relocation code places a few symbols in the text segment. These symbols are only 4 byte aligned where they need to be 8 byte aligned. Add an explicit alignment.
--- arch/powerpc/kernel/reloc_64.S | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/kernel/reloc_64.S +1 -0
@@ -81,6 +81,7 @@ _GLOBAL(relocate) 6: blr +.balign 8 p_dyn: .llong __dynamic_start - 0b p_rela: .llong __rela_dyn_start - 0b p_st: .llong _stext - 0b
PATCH 166/200 libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8 (2BA30001)
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Michele Baldessari <[email protected]>
commit b28a613e9138e4b3a64649bd60b13436f4b4b49b upstream.
Via commit 87809942d3fa "libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8" we added a quirk for disks named "ST1000LM024 HN-M101MBB" with firmware revision "2AR10001".
As reported on https://bugzilla.redhat.com/show_bug.cgi?id=1073901,
we need to also add firmware revision 2BA30001 as it is broken as well.
--- drivers/ata/libata-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/ata/libata-core.c +1 -0
@@ -4109,6 +4109,7 @@ static const struct ata_blacklist_entry/* Seagate Momentus SpinPoint M8 seem to have FPMDA_AA issues */ { "ST1000LM024 HN-M101MBB", "2AR10001", ATA_HORKAGE_BROKEN_FPDMA_AA }, + { "ST1000LM024 HN-M101MBB", "2BA30001", ATA_HORKAGE_BROKEN_FPDMA_AA },/* Blacklist entries taken from Silicon Image 3124/3132 Windows driver .inf file - also several Linux problem reports */
PATCH 167/200 usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Julius Werner <[email protected]>
commit e0429362ab15c46ea4d64c3f8c9e0933e48a143a upstream.
We've encountered a rare issue when enumerating two Logitech webcams after a reboot that doesn't power cycle the USB ports. They are spewing random data (possibly some leftover UVC buffers) on the second (full-sized) Get Configuration request of the enumeration phase. Since the data is random this can potentially cause all kinds of odd behavior, and since it occasionally happens multiple times (after the kernel issues another reset due to the garbled configuration descriptor), it is not always recoverable. Set the USB_DELAY_INIT quirk that seems to work around the issue.
--- drivers/usb/core/quirks.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/core/quirks.c +4 -0
@@ -46,6 +46,10 @@ static const struct usb_device_id usb_qu/* Microsoft LifeCam-VX700 v2.0 */ { USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Logitech HD Pro Webcams C920 and C930e */ + { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, + { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT }, + /* Logitech Quickcam Fusion */ { USB_DEVICE(0x046d, 0x08c1), .driver_info = USB_QUIRK_RESET_RESUME },
PATCH 168/200 usb: Make DELAY_INIT quirk wait 100ms between Get Configuration requests
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Julius Werner <[email protected]>
commit d86db25e53fa69e3e97f3b55dd82a70689787c5d upstream.
The DELAY_INIT quirk only reduces the frequency of enumeration failures with the Logitech HD Pro C920 and C930e webcams, but does not quite eliminate them. We have found that adding a delay of 100ms between the first and second Get Configuration request makes the device enumerate perfectly reliable even after several weeks of extensive testing. The reasons for that are anyone's guess, but since the DELAY_INIT quirk already delays enumeration by a whole second, wating for another 10th of that isn't really a big deal for the one other device that uses it, and it will resolve the problems with these webcams.
--- drivers/usb/core/config.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/core/config.c +4 -0
@@ -722,6 +722,10 @@ int usb_get_configuration(struct usb_dev result = -ENOMEM ; goto err; } + +if (dev->quirks &USB_QUIRK_DELAY_INIT ) +msleep (100 ); + result =usb_get_descriptor (dev,USB_DT_CONFIG , cfgno, bigbuffer, length);if (result <0 ) {
PATCH 169/200 isci: fix reset timeout handling
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit ddfadd7736b677de2d4ca2cd5b4b655368c85a7a upstream.
Remove an erroneous BUG_ON() in the case of a hard reset timeout. The reset timeout handler puts the port into the "awaiting link-up" state. The timeout causes the device to be disconnected and we need to be in the awaiting link-up state to re-connect the port. The BUG_ON() made the incorrect assumption that resets never timeout and we always complete the reset in the "resetting" state.
Testing this patch also uncovered that libata continues to attempt to reset the port long after the driver has torn down the context. Once the driver has committed to abandoning the link it must indicate to libata that recovery ends by returning -ENODEV from ->lldd_I_T_nexus_reset().
--- drivers/scsi/isci/port_config.c | 7 ------- drivers/scsi/isci/task.c | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-)
drivers/scsi/isci/port_config.c +0 -7
@@ -610,13 +610,6 @@ static void sci_apc_agent_link_up(structsci_apc_agent_configure_ports (ihost, port_agent, iphy, true); }else {/* the phy is already the part of the port */ -u32 port_state = iport->sm.current_state_id; - -/* if the PORT'S state is resetting then the link up is from -* port hard reset in this case, we need to tell the port -* that link up is recieved -*/ -BUG_ON (port_state !=SCI_PORT_RESETTING ); port_agent->phy_ready_mask |=1 << phy_index;sci_port_link_up (iport, iphy); }
drivers/scsi/isci/task.c +1 -1
@@ -1390,7 +1390,7 @@ int isci_task_I_T_nexus_reset(struct domspin_unlock_irqrestore (&ihost->scic_lock, flags);if (!idev || !test_bit (IDEV_EH , &idev->flags)) { - ret =TMF_RESP_FUNC_COMPLETE ; + ret = -ENODEV ; goto out; }
PATCH 170/200 isci: correct erroneous for_each_isci_host macro
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Lukasz Dorau <[email protected]>
commit c59053a23d586675c25d789a7494adfdc02fba57 upstream.
In the first place, the loop 'for' in the macro 'for_each_isci_host' (drivers/scsi/isci/host.h:314) is incorrect, because it accesses the 3rd element of 2 element array. After the 2nd iteration it executes the instruction:
ihost = to_pci_info(pdev)->hosts[2]
(while the size of the 'hosts' array equals 2) and reads an out of range element.
In the second place, this loop is incorrectly optimized by GCC v4.8 (see http://marc.info/?l=linux-kernel&m=138998871911336&w=2).
As a result, on platforms with two SCU controllers,
the loop is executed more times than it can be (for i=0,1 and 2). It causes kernel panic during entering the S3 state
and the following oops after 'rmmod isci':
BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff8131360b>] __list_add+0x1b/0xc0 Oops: 0000 [#1] SMP RIP: 0010:[<ffffffff8131360b>] [<ffffffff8131360b>] __list_add+0x1b/0xc0 Call Trace: [<ffffffff81661b84>] __mutex_lock_slowpath+0x114/0x1b0 [<ffffffff81661c3f>] mutex_lock+0x1f/0x30 [<ffffffffa03e97cb>] sas_disable_events+0x1b/0x50 [libsas] [<ffffffffa03e9818>] sas_unregister_ha+0x18/0x60 [libsas] [<ffffffffa040316e>] isci_unregister+0x1e/0x40 [isci] [<ffffffffa0403efd>] isci_pci_remove+0x5d/0x100 [isci] [<ffffffff813391cb>] pci_device_remove+0x3b/0xb0 [<ffffffff813fbf7f>] __device_release_driver+0x7f/0xf0 [<ffffffff813fc8f8>] driver_detach+0xa8/0xb0 [<ffffffff813fbb8b>] bus_remove_driver+0x9b/0x120 [<ffffffff813fcf2c>] driver_unregister+0x2c/0x50 [<ffffffff813381f3>] pci_unregister_driver+0x23/0x80 [<ffffffffa04152f8>] isci_exit+0x10/0x1e [isci] [<ffffffff810d199b>] SyS_delete_module+0x16b/0x2d0 [<ffffffff81012a21>] ? do_notify_resume+0x61/0xa0 [<ffffffff8166ce29>] system_call_fastpath+0x16/0x1b
The loop has been corrected.
This patch fixes kernel panic during entering the S3 state and the above oops.
--- drivers/scsi/isci/host.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/isci/host.h +2 -3
@@ -309,9 +309,8 @@ static inline struct isci_pci_info *to_p }#define for_each_isci_host (id, ihost, pdev) \ - for (id = 0, ihost = to_pci_info(pdev)->hosts[id]; \ - id < ARRAY_SIZE(to_pci_info(pdev)->hosts) && ihost; \ - ihost = to_pci_info(pdev)->hosts[++id]) + for (id = 0; id < SCI_MAX_CONTROLLERS && \ + (ihost = to_pci_info(pdev)->hosts[id]); id++)static inline enum isci_status isci_host_get_state (struct isci_host *isci_host) {
PATCH 171/200 qla2xxx: Poll during initialization for ISP25xx and ISP83xx
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Giridhar Malavali <[email protected]>
commit b77ed25c9f8402e8b3e49e220edb4ef09ecfbb53 upstream.
[bwh: Backported to 3.2:
- Adjust context
- QLA83XX was not included]
--- drivers/scsi/qla2xxx/qla_def.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +1 -2
@@ -2568,8 +2568,7 @@ struct qla_hw_data { IS_QLA25XX(ha) || IS_QLA81XX(ha) || \ IS_QLA82XX(ha))#define IS_MSIX_NACK_CAPABLE (ha) (IS_QLA81XX(ha)) -#define IS_NOPOLLING_TYPE (ha) ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && \ - (ha)->flags.msix_enabled) +#define IS_NOPOLLING_TYPE (ha) (IS_QLA81XX(ha) && (ha)->flags.msix_enabled)#define IS_FAC_REQUIRED (ha) (IS_QLA81XX(ha))#define IS_NOCACHE_VPD_TYPE (ha) (IS_QLA81XX(ha))#define IS_ALOGIO_CAPABLE (ha) (IS_QLA23XX(ha) || IS_FWI2_CAPABLE(ha))
PATCH 172/200 ocfs2 syncs the wrong range...
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
commit 1b56e98990bcdbb20b9fab163654b9315bf158e8 upstream.
--- fs/ocfs2/file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/ocfs2/file.c +4 -4
@@ -2389,8 +2389,8 @@ out_dio:if (((file->f_flags &O_DSYNC ) && !direct_io) ||IS_SYNC (inode) || ((file->f_flags &O_DIRECT ) && !direct_io)) { - ret =filemap_fdatawrite_range (file->f_mapping, pos, - pos + count -1 ); + ret =filemap_fdatawrite_range (file->f_mapping, *ppos, + *ppos + count -1 );if (ret <0 ) written = ret;
@@ -2403,8 +2403,8 @@ out_dio: }if (!ret) - ret =filemap_fdatawait_range (file->f_mapping, pos, - pos + count -1 ); + ret =filemap_fdatawait_range (file->f_mapping, *ppos, + *ppos + count -1 ); }/*
PATCH 173/200 vmxnet3: fix netpoll race condition
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Neil Horman <[email protected]>
commit d25f06ea466ea521b563b76661180b4e44714ae6 upstream.
vmxnet3's netpoll driver is incorrectly coded. It directly calls vmxnet3_do_poll, which is the driver internal napi poll routine. As the netpoll controller method doesn't block real napi polls in any way, there is a potential for race conditions in which the netpoll controller method and the napi poll method run concurrently. The result is data corruption causing panics such as this one recently observed:
PID: 1371 TASK: ffff88023762caa0 CPU: 1 COMMAND: "rs:main Q:Reg"
#0 [ffff88023abd5780] machine_kexec at ffffffff81038f3b
#1 [ffff88023abd57e0] crash_kexec at ffffffff810c5d92
#2 [ffff88023abd58b0] oops_end at ffffffff8152b570
#3 [ffff88023abd58e0] die at ffffffff81010e0b
#4 [ffff88023abd5910] do_trap at ffffffff8152add4
#5 [ffff88023abd5970] do_invalid_op at ffffffff8100cf95
#6 [ffff88023abd5a10] invalid_op at ffffffff8100bf9b
[exception RIP: vmxnet3_rq_rx_complete+1968]
RIP: ffffffffa00f1e80 RSP: ffff88023abd5ac8 RFLAGS: 00010086
RAX: 0000000000000000 RBX: ffff88023b5dcee0 RCX: 00000000000000c0
RDX: 0000000000000000 RSI: 00000000000005f2 RDI: ffff88023b5dcee0
RBP: ffff88023abd5b48 R8: 0000000000000000 R9: ffff88023a3b6048
R10: 0000000000000000 R11: 0000000000000002 R12: ffff8802398d4cd8
R13: ffff88023af35140 R14: ffff88023b60c890 R15: 0000000000000000
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 #7 [ffff88023abd5b50] vmxnet3_do_poll at ffffffffa00f204a [vmxnet3] #8 [ffff88023abd5b80] vmxnet3_netpoll at ffffffffa00f209c [vmxnet3] #9 [ffff88023abd5ba0] netpoll_poll_dev at ffffffff81472bb7
The fix is to do as other drivers do, and have the poll controller call the top half interrupt handler, which schedules a napi poll properly to recieve frames
Tested by myself, successfully.
--- drivers/net/vmxnet3/vmxnet3_drv.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/net/vmxnet3/vmxnet3_drv.c +11 -5
@@ -1733,12 +1733,18 @@ static void vmxnet3_netpoll(struct net_device *netdev) {struct vmxnet3_adapter *adapter =netdev_priv (netdev); +int i; -if (adapter->intr.mask_mode ==VMXNET3_IMM_ACTIVE ) -vmxnet3_disable_all_intrs (adapter); - -vmxnet3_do_poll (adapter, adapter->rx_queue[0 ].rx_ring[0 ].size); -vmxnet3_enable_all_intrs (adapter); +switch (adapter->intr.type) { +case VMXNET3_IT_MSIX : +for (i =0 ; i < adapter->num_rx_queues; i++) +vmxnet3_msix_rx (0 , &adapter->rx_queue[i]); +break ; +case VMXNET3_IT_MSI : +default : +vmxnet3_intr (0 , adapter->netdev); +break ; + } }#endif /* CONFIG_NET_POLL_CONTROLLER */
PATCH 174/200 KVM: SVM: fix cr8 intercept window
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Radim Krčmář <[email protected]>
commit 596f3142d2b7be307a1652d59e7b93adab918437 upstream.
We always disable cr8 intercept in its handler, but only re-enable it if handling KVM_REQ_EVENT, so there can be a window where we do not intercept cr8 writes, which allows an interrupt to disrupt a higher priority task.
Fix this by disabling intercepts in the same function that re-enables them when needed. This fixes BSOD in Windows 2008.
--- arch/x86/kvm/svm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/kvm/svm.c +3 -3
@@ -2904,10 +2904,8 @@ static int cr8_write_interception(structu8 cr8_prev =kvm_get_cr8 (&svm->vcpu);/* instruction emulation calls kvm_set_cr8() */ r =cr_interception (svm); -if (irqchip_in_kernel (svm->vcpu.kvm)) { -clr_cr_intercept (svm,INTERCEPT_CR8_WRITE ); +if (irqchip_in_kernel (svm->vcpu.kvm))return r; - }if (cr8_prev <=kvm_get_cr8 (&svm->vcpu))return r; kvm_run->exit_reason =KVM_EXIT_SET_TPR ;
@@ -3462,6 +3460,8 @@ static void update_cr8_intercept(structif (is_guest_mode (vcpu) && (vcpu->arch.hflags &HF_VINTR_MASK ))return ; +clr_cr_intercept (svm,INTERCEPT_CR8_WRITE ); +if (irr ==-1 )return ;
PATCH 175/200 vmxnet3: fix building without CONFIG_PCI_MSI
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 0a8d8c446b5429d15ff2d48f46e00d8a08552303 upstream.
Since commit d25f06ea466e "vmxnet3: fix netpoll race condition", the vmxnet3 driver fails to build when CONFIG_PCI_MSI is disabled, because it unconditionally references the vmxnet3_msix_rx() function.
To fix this, use the same #ifdef in the caller that exists around the function definition.
--- drivers/net/vmxnet3/vmxnet3_drv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/vmxnet3/vmxnet3_drv.c +5 -2
@@ -1733,13 +1733,16 @@ static void vmxnet3_netpoll(struct net_device *netdev) {struct vmxnet3_adapter *adapter =netdev_priv (netdev); -int i;switch (adapter->intr.type) { -case VMXNET3_IT_MSIX : +#ifdef CONFIG_PCI_MSI +case VMXNET3_IT_MSIX : { +int i;for (i =0 ; i < adapter->num_rx_queues; i++)vmxnet3_msix_rx (0 , &adapter->rx_queue[i]);break ; + } +#endif case VMXNET3_IT_MSI :default :vmxnet3_intr (0 , adapter->netdev);
PATCH 176/200 x86/amd/numa: Fix northbridge quirk to assign correct NUMA node
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Daniel J Blueman <[email protected]>
commit 847d7970defb45540735b3fb4e88471c27cacd85 upstream.
For systems with multiple servers and routed fabric, all northbridges get assigned to the first server. Fix this by also using the node reported from the PCI bus. For single-fabric systems, the northbriges are on PCI bus 0 by definition, which are on NUMA node 0 by definition, so this is invarient on most systems.
Tested on fam10h and fam15h single and multi-fabric systems and candidate for stable.
--- arch/x86/kernel/quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/quirks.c +1 -1
@@ -525,7 +525,7 @@ static void __init quirk_amd_nb_node(strreturn ;pci_read_config_dword (nb_ht,0x60 , &val); - node = val &7 ; + node =pcibus_to_node (dev->bus) | (val &7 );/* * Some hardware may return an invalid node ID, * so check it first:
PATCH 177/200 staging: comedi: ssv_dnp: correct insn_bits result
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ian Abbott <[email protected]>
[Part of commit f6b316bcd8c421acd6fa5a6e18b4c846ecb9d965 upstream. Split from original patch subject: "staging: comedi: ssv_dnp: use comedi_dio_update_state()"]
Also, fix a bug where the state of the channels is returned in data[0]. The comedi core expects it to be returned in data[1].
--- drivers/staging/comedi/drivers/ssv_dnp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/comedi/drivers/ssv_dnp.c +3 -3
@@ -251,11 +251,11 @@ static int dnp_dio_insn_bits(struct come/* on return, data[1] contains the value of the digital input lines. */ outb (PADR ,CSCIR ); - data[0 ] =inb (CSCDR ); + data[1 ] =inb (CSCDR );outb (PBDR ,CSCIR ); - data[0 ] +=inb (CSCDR ) <<8 ; + data[1 ] +=inb (CSCDR ) <<8 ;outb (PCDR ,CSCIR ); - data[0 ] += ((inb (CSCDR ) &0xF0 ) <<12 ); + data[1 ] += ((inb (CSCDR ) &0xF0 ) <<12 );return 2 ;
PATCH 178/200 staging: comedi: pcmuio: fix possible NULL deref on detach
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ian Abbott <[email protected]>
commit 2fd2bdfccae61efe18f6b92b6a45fbf936d75b48 upstream.
pcmuio_detach() is called by the comedi core even if pcmuio_attach() returned an error, so dev->private might be NULL. Check for that before dereferencing it.
Also, as pointed out by Dan Carpenter, there is no need to check the pointer passed to kfree() is non-NULL, so remove that check.
--- drivers/staging/comedi/drivers/pcmuio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/comedi/drivers/pcmuio.c +6 -6
@@ -464,13 +464,13 @@ static int pcmuio_detach(struct comedi_device *dev)if (dev->iobase)release_region (dev->iobase,ASIC_IOSIZE * thisboard->num_asics); -for (i =0 ; i <MAX_ASICS ; ++i) { -if (devpriv->asics[i].irq) -free_irq (devpriv->asics[i].irq, dev); - } - -if (devpriv && devpriv->sprivs) +if (devpriv) { +for (i =0 ; i <MAX_ASICS ; ++i) { +if (devpriv->asics[i].irq) +free_irq (devpriv->asics[i].irq, dev); + }kfree (devpriv->sprivs); + }return 0 ; }
PATCH 179/200 nfs: fix do_div() warning by instead using sector_div()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
commit 3873d064b8538686bbbd4b858dc8a07db1f7f43a upstream.
When compiling a 32bit kernel with CONFIG_LBDAF=n the compiler complains like shown below. Fix this warning by instead using sector_div() which is provided by the kernel.h header file.
fs/nfs/blocklayout/extents.c: In function ‘normalize’:include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/blocklayout/extents.c:47:13: note: in expansion of macro ‘do_div’nfs/blocklayout/extents.c:47:2: warning: right shift count >= width of type [enabled by default] fs/nfs/blocklayout/extents.c:47:2: warning: passing argument 1 of ‘__div64_32’ from incompatible pointer type [enabled by default] include/asm-generic/div64.h:35:17: note: expected ‘uint64_t *’ but argument is of type ‘sector_t *’
extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
---
fs/nfs/blocklayout/extents.c +1 -1
@@ -44,7 +44,7 @@static inline sector_t normalize (sector_t s,int base) {sector_t tmp = s;/* Since do_div modifies its argument */ -return s -do_div (tmp, base); +return s -sector_div (tmp, base); }static inline sector_t normalize_up (sector_t s,int base)
PATCH 180/200 mm/hugetlb: check for pte NULL pointer in __page_check_address()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jianguo Wu <[email protected]>
commit 98398c32f6687ee1e1f3ae084effb4b75adb0747 upstream.
In __page_check_address(), if address's pud is not present, huge_pte_offset() will return NULL, we should check the return value.
--- mm/rmap.c | 4 ++++ 1 file changed, 4 insertions(+)
mm/rmap.c +4 -0
@@ -581,7 +581,11 @@ pte_t *__page_check_address(struct pagespinlock_t *ptl;if (unlikely (PageHuge (page))) { +/* when pud is not present, pte will be NULL */ pte =huge_pte_offset (mm, address); +if (!pte) +return NULL ; + ptl = &mm->page_table_lock; goto check; }
PATCH 181/200 TTY: pmac_zilog, check existence of ports in pmz_console_init()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit dc1dc2f8a5dd863bf2e79f338fc3ae29e99c683a upstream.
When booting a multi-platform m68k kernel on a non-Mac with "console=ttyS0" on the kernel command line, it crashes with:
Unable to handle kernel NULL pointer dereference at virtual address (null) Oops: 00000000 PC: [<0013ad28>] __pmz_startup+0x32/0x2a0 ... Call Trace: [<002c5d3e>] pmz_console_setup+0x64/0xe4
The normal tty driver doesn't crash, because init_pmz() checks pmz_ports_count again after calling pmz_probe().
In the serial console initialization path, pmz_console_init() doesn't do this, causing the driver to crash later.
Add a check for pmz_ports_count to fix this.
--- drivers/tty/serial/pmac_zilog.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/tty/serial/pmac_zilog.c +3 -0
@@ -2198,6 +2198,9 @@ static int __init pmz_console_init(void)/* Probe ports */ pmz_probe (); +if (pmz_ports_count ==0 ) +return -ENODEV ; +/* TODO: Autoprobe console based on OF */ /* pmz_console.index = i; */ register_console (&pmz_console);
PATCH 182/200 hpfs: remember free space
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit 2cbe5c76fc5e38e9af4b709593146e4b8272b69e upstream.
Previously, hpfs scanned all bitmaps each time the user asked for free space using statfs. This patch changes it so that hpfs scans the bitmaps only once, remembes the free space and on next invocation of statfs it returns the value instantly.
New versions of wine are hammering on the statfs syscall very heavily, making some games unplayable when they're stored on hpfs, with load times in minutes.
This should be backported to the stable kernels because it fixes user-visible problem (excessive level load times in wine).
--- fs/hpfs/alloc.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- fs/hpfs/hpfs_fn.h | 2 +- fs/hpfs/super.c | 32 ++++++++++++++++++++------- 3 files changed, 89 insertions(+), 11 deletions(-)
fs/hpfs/alloc.c +64 -2
@@ -8,6 +8,58 @@#include "hpfs_fn.h" +static void hpfs_claim_alloc (struct super_block *s,secno sec) +{ +struct hpfs_sb_info *sbi =hpfs_sb (s); +if (sbi->sb_n_free != (unsigned )-1 ) { +if (unlikely (!sbi->sb_n_free)) { +hpfs_error (s,"free count underflow, allocating sector %08x" , sec); + sbi->sb_n_free =-1 ; +return ; + } + sbi->sb_n_free--; + } +} + +static void hpfs_claim_free (struct super_block *s,secno sec) +{ +struct hpfs_sb_info *sbi =hpfs_sb (s); +if (sbi->sb_n_free != (unsigned )-1 ) { +if (unlikely (sbi->sb_n_free >= sbi->sb_fs_size)) { +hpfs_error (s,"free count overflow, freeing sector %08x" , sec); + sbi->sb_n_free =-1 ; +return ; + } + sbi->sb_n_free++; + } +} + +static void hpfs_claim_dirband_alloc (struct super_block *s,secno sec) +{ +struct hpfs_sb_info *sbi =hpfs_sb (s); +if (sbi->sb_n_free_dnodes != (unsigned )-1 ) { +if (unlikely (!sbi->sb_n_free_dnodes)) { +hpfs_error (s,"dirband free count underflow, allocating sector %08x" , sec); + sbi->sb_n_free_dnodes =-1 ; +return ; + } + sbi->sb_n_free_dnodes--; + } +} + +static void hpfs_claim_dirband_free (struct super_block *s,secno sec) +{ +struct hpfs_sb_info *sbi =hpfs_sb (s); +if (sbi->sb_n_free_dnodes != (unsigned )-1 ) { +if (unlikely (sbi->sb_n_free_dnodes >= sbi->sb_dirband_size /4 )) { +hpfs_error (s,"dirband free count overflow, freeing sector %08x" , sec); + sbi->sb_n_free_dnodes =-1 ; +return ; + } + sbi->sb_n_free_dnodes++; + } +} +/* * Check if a sector is allocated in bitmap * This is really slow. Turned on only if chk==2
@@ -203,9 +255,15 @@ secno hpfs_alloc_sector(struct super_blo } sec =0 ; ret: +if (sec) { + i =0 ; +do +hpfs_claim_alloc (s, sec + i); +while (unlikely (++i < n)); + }if (sec && f_p) {for (i =0 ; i < forward; i++) { -if (!hpfs_alloc_if_possible (s, sec + i +1 )) { +if (!hpfs_alloc_if_possible (s, sec + n + i)) {hpfs_error (s,"Prealloc doesn't work! Wanted %d, allocated at %08x, can't allocate %d" , forward, sec, i); sec =0 ;break ;
@@ -228,6 +286,7 @@ static secno alloc_in_dirband(struct sup nr >>=2 ; sec =alloc_in_bmp (s, (~0x3fff ) | nr,1 ,0 );if (!sec)return 0 ; +hpfs_claim_dirband_alloc (s, sec);return ((sec &0x3fff ) <<2 ) + sbi->sb_dirband_start; }
@@ -242,6 +301,7 @@ int hpfs_alloc_if_possible(struct super_ bmp[(sec &0x3fff ) >>5 ] &=cpu_to_le32 (~(1 << (sec &0x1f )));hpfs_mark_4buffers_dirty (&qbh);hpfs_brelse4 (&qbh); +hpfs_claim_alloc (s, sec);return 1 ; }hpfs_brelse4 (&qbh);
@@ -275,6 +335,7 @@ void hpfs_free_sectors(struct super_blocreturn ; } bmp[(sec &0x3fff ) >>5 ] |=cpu_to_le32 (1 << (sec &0x1f )); +hpfs_claim_free (s, sec);if (!--n) {hpfs_mark_4buffers_dirty (&qbh);hpfs_brelse4 (&qbh);
@@ -359,6 +420,7 @@ void hpfs_free_dnode(struct super_block bmp[ssec >>5 ] |=cpu_to_le32 (1 << (ssec &0x1f ));hpfs_mark_4buffers_dirty (&qbh);hpfs_brelse4 (&qbh); +hpfs_claim_dirband_free (s, dno); } }
@@ -366,7 +428,7 @@ struct dnode *hpfs_alloc_dnode(struct su dnode_secno *dno, struct quad_buffer_head *qbh) { struct dnode *d; -if (hpfs_count_one_bitmap (s,hpfs_sb (s)->sb_dmap) >FREE_DNODES_ADD ) { +if (hpfs_get_free_dnodes (s) >FREE_DNODES_ADD ) {if (!(*dno =alloc_in_dirband (s, near)))if (!(*dno =hpfs_alloc_sector (s, near,4 ,0 )))return NULL ; }else {
fs/hpfs/hpfs_fn.h +1 -1
@@ -314,7 +314,7 @@ static inline struct hpfs_sb_info *hpfs_ __printf(2, 3)void hpfs_error (struct super_block *,const char *, ...);int hpfs_stop_cycles (struct super_block *,int ,int *,int *,char *); -unsigned hpfs_count_one_bitmap (struct super_block *,secno ); +unsigned hpfs_get_free_dnodes (struct super_block *);/* * local time (HPFS) to GMT (Unix)
fs/hpfs/super.c +24 -8
@@ -115,7 +115,7 @@ static void hpfs_put_super(struct super_kfree (sbi); } -unsigned hpfs_count_one_bitmap (struct super_block *s,secno secno) +static unsigned hpfs_count_one_bitmap (struct super_block *s,secno secno) {struct quad_buffer_head qbh;unsigned long *bits;
@@ -123,7 +123,7 @@ unsigned hpfs_count_one_bitmap(struct su bits =hpfs_map_4sectors (s, secno, &qbh,4 );if (!bits) -return 0 ; +return (unsigned )-1 ; count =bitmap_weight (bits,2048 *BITS_PER_BYTE );hpfs_brelse4 (&qbh);return count;
@@ -134,29 +134,45 @@ static unsigned count_bitmaps(struct supunsigned n, count, n_bands; n_bands = (hpfs_sb (s)->sb_fs_size +0x3fff ) >>14 ; count =0 ; -for (n =0 ; n < n_bands; n++) - count +=hpfs_count_one_bitmap (s,le32_to_cpu (hpfs_sb (s)->sb_bmp_dir[n])); +for (n =0 ; n < n_bands; n++) { +unsigned c; + c =hpfs_count_one_bitmap (s,le32_to_cpu (hpfs_sb (s)->sb_bmp_dir[n])); +if (c != (unsigned )-1 ) + count += c; + }return count; } +unsigned hpfs_get_free_dnodes (struct super_block *s) +{ +struct hpfs_sb_info *sbi =hpfs_sb (s); +if (sbi->sb_n_free_dnodes == (unsigned )-1 ) { +unsigned c =hpfs_count_one_bitmap (s, sbi->sb_dmap); +if (c == (unsigned )-1 ) +return 0 ; + sbi->sb_n_free_dnodes = c; + } +return sbi->sb_n_free_dnodes; +} +static int hpfs_statfs (struct dentry *dentry,struct kstatfs *buf) {struct super_block *s = dentry->d_sb;struct hpfs_sb_info *sbi =hpfs_sb (s);u64 id =huge_encode_dev (s->s_bdev->bd_dev); +hpfs_lock (s); -/*if (sbi->sb_n_free == -1) {*/ +if (sbi->sb_n_free == (unsigned )-1 ) sbi->sb_n_free =count_bitmaps (s); - sbi->sb_n_free_dnodes =hpfs_count_one_bitmap (s, sbi->sb_dmap); -/*}*/ + buf->f_type = s->s_magic; buf->f_bsize =512 ; buf->f_blocks = sbi->sb_fs_size; buf->f_bfree = sbi->sb_n_free; buf->f_bavail = sbi->sb_n_free; buf->f_files = sbi->sb_dirband_size /4 ; - buf->f_ffree = sbi->sb_n_free_dnodes; + buf->f_ffree =hpfs_get_free_dnodes (s); buf->f_fsid.val[0 ] = (u32 )id; buf->f_fsid.val[1 ] = (u32)(id >>32 ); buf->f_namelen =254 ;
PATCH 183/200 hpfs: deadlock and race in directory lseek()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
commit 31abdab9c11bb1694ecd1476a7edbe8e964d94ac upstream.
For one thing, there's an ABBA deadlock on hpfs fs-wide lock and i_mutex in hpfs_dir_lseek() - there's a lot of methods that grab the former with the caller already holding the latter, so it must take i_mutex first.
For another, locking the damn thing, carefully validating the offset, then dropping locks and assigning the offset is obviously racy.
Moreover, we _must_ do hpfs_add_pos(), or the machinery in dnode.c won't modify the sucker on B-tree surgeries.
--- fs/hpfs/dir.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fs/hpfs/dir.c +6 -4
@@ -33,25 +33,27 @@ static loff_t hpfs_dir_lseek(struct fileif (whence ==SEEK_DATA || whence ==SEEK_HOLE )return -EINVAL ; +mutex_lock (&i->i_mutex);hpfs_lock (s);/*printk("dir lseek\n");*/ if (new_off ==0 || new_off ==1 || new_off ==11 || new_off ==12 || new_off ==13 ) goto ok; -mutex_lock (&i->i_mutex); pos = ((loff_t )hpfs_de_as_down_as_possible (s, hpfs_inode->i_dno) <<4 ) +1 ;while (pos != new_off) {if (map_pos_dirent (i, &pos, &qbh))hpfs_brelse4 (&qbh);else goto fail;if (pos ==12 ) goto fail; } -mutex_unlock (&i->i_mutex); +hpfs_add_pos (i, &filp->f_pos); ok: + filp->f_pos = new_off;hpfs_unlock (s); -return filp->f_pos = new_off; -fail:mutex_unlock (&i->i_mutex); +return new_off; +fail:/*printk("illegal lseek: %016llx\n", new_off);*/ hpfs_unlock (s); +mutex_unlock (&i->i_mutex);return -ESPIPE ; }
PATCH 184/200 ftrace: Have function graph only trace based on global_ops filters
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <[email protected]>
commit 23a8e8441a0a74dd612edf81dc89d1600bc0a3d1 upstream.
Doing some different tests, I discovered that function graph tracing, when filtered via the set_ftrace_filter and set_ftrace_notrace files, does not always keep with them if another function ftrace_ops is registered to trace functions.
The reason is that function graph just happens to trace all functions that the function tracer enables. When there was only one user of function tracing, the function graph tracer did not need to worry about being called by functions that it did not want to trace. But now that there are other users, this becomes a problem.
For example, one just needs to do the following:
# cd /sys/kernel/debug/tracing
# echo schedule > set_ftrace_filter
# echo function_graph > current_tracer
# cat trace
[..]
0) | schedule() {
------------------------------------------
0) <idle>-0 => rcu_pre-7
------------------------------------------ 0) ! 2980.314 us | }
0) | schedule() { ------------------------------------------
0) rcu_pre-7 => <idle>-0
------------------------------------------
0) + 20.701 us | }
# echo 1 > /proc/sys/kernel/stack_tracer_enabled
# cat trace
[..]
1) + 20.825 us | }
1) + 21.651 us | }
1) + 30.924 us | } /* SyS_ioctl */
1) | do_page_fault() {
1) | __do_page_fault() {
1) 0.274 us | down_read_trylock();
1) 0.098 us | find_vma();
1) | handle_mm_fault() {
1) | _raw_spin_lock() {
1) 0.102 us | preempt_count_add();
1) 0.097 us | do_raw_spin_lock();
1) 2.173 us | }
1) | do_wp_page() {
1) 0.079 us | vm_normal_page();
1) 0.086 us | reuse_swap_page();
1) 0.076 us | page_move_anon_rmap();
1) | unlock_page() {
1) 0.082 us | page_waitqueue();
1) 0.086 us | __wake_up_bit();
1) 1.801 us | }
1) 0.075 us | ptep_set_access_flags();
1) | _raw_spin_unlock() {
1) 0.098 us | do_raw_spin_unlock();
1) 0.105 us | preempt_count_sub();
1) 1.884 us | }
1) 9.149 us | }
1) + 13.083 us | }
1) 0.146 us | up_read();When the stack tracer was enabled, it enabled all functions to be traced, which now the function graph tracer also traces. This is a side effect that should not occur.
To fix this a test is added when the function tracing is changed, as well as when the graph tracer is enabled, to see if anything other than the ftrace global_ops function tracer is enabled. If so, then the graph tracer calls a test trampoline that will look at the function that is being traced and compare it with the filters defined by the global_ops.
As an optimization, if there's no other function tracers registered, or if the only registered function tracers also use the global ops, the function graph infrastructure will call the registered function graph callback directly and not go through the test trampoline.
--- kernel/trace/ftrace.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-)
kernel/trace/ftrace.c +44 -1
@@ -190,6 +190,12 @@ static void update_global_ops(void) global_ops.func = func; } +#ifdef CONFIG_FUNCTION_GRAPH_TRACER +static void update_function_graph_func (void ); +#else +static inline void update_function_graph_func (void ) { } +#endif +static void update_ftrace_function (void ) {ftrace_func_t func;
@@ -237,6 +243,8 @@ static int remove_ftrace_ops(struct ftra {struct ftrace_ops **p; +update_function_graph_func (); +/* * If we are removing the last function, then simply point * to the ftrace_stub.
@@ -4067,6 +4075,7 @@ int ftrace_graph_entry_stub(struct ftractrace_func_graph_ret_t ftrace_graph_return = (trace_func_graph_ret_t )ftrace_stub;trace_func_graph_ent_t ftrace_graph_entry = ftrace_graph_entry_stub; +static trace_func_graph_ent_t __ftrace_graph_entry = ftrace_graph_entry_stub;/* Try to assign a return stack array on FTRACE_RETSTACK_ALLOC_SIZE tasks. */ static int alloc_retstack_tasklist (struct ftrace_ret_stack **ret_stack_list)
@@ -4207,6 +4216,30 @@ static struct ftrace_ops fgraph_ops __re .flags = FTRACE_OPS_FL_GLOBAL, }; +static int ftrace_graph_entry_test (struct ftrace_graph_ent *trace) +{ +if (!ftrace_ops_test (&global_ops, trace->func)) +return 0 ; +return __ftrace_graph_entry (trace); +} + +/* +* The function graph tracer should only trace the functions defined +* by set_ftrace_filter and set_ftrace_notrace. If another function +* tracer ops is registered, the graph tracer requires testing the +* function against the global ops, and not just trace any function +* that any ftrace_ops registered. +*/ +static void update_function_graph_func (void ) +{ +if (ftrace_ops_list == &ftrace_list_end || + (ftrace_ops_list == &global_ops && + global_ops.next == &ftrace_list_end)) + ftrace_graph_entry = __ftrace_graph_entry; +else + ftrace_graph_entry = ftrace_graph_entry_test; +} +int register_ftrace_graph (trace_func_graph_ret_t retfunc,trace_func_graph_ent_t entryfunc) {
@@ -4231,7 +4264,16 @@ int register_ftrace_graph(trace_func_gra } ftrace_graph_return = retfunc; - ftrace_graph_entry = entryfunc; + +/* +* Update the indirect function to the entryfunc, and the +* function that gets called to the entry_test first. Then +* call the update fgraph entry function to determine if +* the entryfunc should be called directly or not. +*/ + __ftrace_graph_entry = entryfunc; + ftrace_graph_entry = ftrace_graph_entry_test; +update_function_graph_func (); ret =ftrace_startup (&fgraph_ops,FTRACE_START_FUNC_RET );
@@ -4250,6 +4292,7 @@ void unregister_ftrace_graph(void) ftrace_graph_active--; ftrace_graph_return = (trace_func_graph_ret_t )ftrace_stub; ftrace_graph_entry = ftrace_graph_entry_stub; + __ftrace_graph_entry = ftrace_graph_entry_stub;ftrace_shutdown (&fgraph_ops,FTRACE_STOP_FUNC_RET );unregister_pm_notifier (&ftrace_suspend_notifier);unregister_trace_sched_switch (ftrace_graph_probe_sched_switch,NULL );
PATCH 185/200 timekeeping: fix 32-bit overflow in get_monotonic_boottime
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Colin Cross <[email protected]>
fixed upstream in v3.6 by ec145babe754f9ea1079034a108104b6001e001c
get_monotonic_boottime adds three nanonsecond values stored in longs, followed by an s64. If the long values are all close to 1e9 the first three additions can overflow and become negative when added to the s64. Cast the first value to s64 so that all additions are 64 bit.
[jstultz: Fished this out of the AOSP commong.git tree. This was fixed upstream in v3.6 by ec145babe754f9ea1079034a108104b6001e001c]
--- kernel/time/timekeeping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/time/timekeeping.c +1 -1
@@ -1161,7 +1161,7 @@ void get_monotonic_boottime(struct times }while (read_seqretry (&xtime_lock, seq));set_normalized_timespec (ts, ts->tv_sec + tomono.tv_sec + sleep.tv_sec, - ts->tv_nsec + tomono.tv_nsec + sleep.tv_nsec + nsecs); + (s64 )ts->tv_nsec + tomono.tv_nsec + sleep.tv_nsec + nsecs); }EXPORT_SYMBOL_GPL (get_monotonic_boottime);
PATCH 186/200 printk: Fix scheduling-while-atomic problem in console_cpu_notify()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "Paul E. McKenney" <[email protected]>
commit 85eae82a0855d49852b87deac8653e4ebc8b291f upstream.
The console_cpu_notify() function runs with interrupts disabled in the CPU_DYING case. It therefore cannot block, for example, as will happen when it calls console_lock(). Therefore, remove the CPU_DYING leg of the switch statement to avoid this problem.
--- kernel/printk.c | 1 - 1 file changed, 1 deletion(-)
kernel/printk.c +0 -1
@@ -1165,7 +1165,6 @@ static int __cpuinit console_cpu_notify(switch (action) {case CPU_ONLINE :case CPU_DEAD : -case CPU_DYING :case CPU_DOWN_FAILED :case CPU_UP_CANCELED :console_lock ();
PATCH 187/200 net: fix 'ip rule' iif/oif device rename
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Żenczykowski <[email protected]>
[ Upstream commit 946c032e5a53992ea45e062ecb08670ba39b99e3 ]
ip rules with iif/oif references do not update:
(detach/attach) across interface renames.
Google-Bug-Id: 12936021
--- net/core/fib_rules.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/core/fib_rules.c +7 -0
@@ -718,6 +718,13 @@ static int fib_rules_event(struct notifier_block *this, unsigned long event,attach_rules (&ops->rules_list, dev);break ; +case NETDEV_CHANGENAME : +list_for_each_entry (ops, &net->rules_ops, list) { +detach_rules (&ops->rules_list, dev); +attach_rules (&ops->rules_list, dev); + } +break ; +case NETDEV_UNREGISTER :list_for_each_entry (ops, &net->rules_ops, list)detach_rules (&ops->rules_list, dev);
PATCH 188/200 tg3: Fix deadlock in tg3_change_mtu()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Nithin Sujir <[email protected]>
[ Upstream commit c6993dfd7db9b0c6b7ca7503a56fda9236a4710f ]
Quoting David Vrabel -
"5780 cards cannot have jumbo frames and TSO enabled together. When jumbo frames are enabled by setting the MTU, the TSO feature must be cleared. This is done indirectly by calling netdev_update_features() which will call tg3_fix_features() to actually clear the flags.
netdev_update_features() will also trigger a new netlink message for the feature change event which will result in a call to tg3_get_stats64() which deadlocks on the tg3 lock."
tg3_set_mtu() does not need to be under the tg3 lock since converting the flags to use set_bit(). Move it out to after tg3_netif_stop().
--- drivers/net/ethernet/broadcom/tg3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +2 -2
@@ -7103,12 +7103,12 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu)tg3_netif_stop (tp); +tg3_set_mtu (dev, tp, new_mtu); +tg3_full_lock (tp,1 );tg3_halt (tp,RESET_KIND_SHUTDOWN ,1 ); -tg3_set_mtu (dev, tp, new_mtu); - err =tg3_restart_hw (tp,0 );if (!err)
PATCH 189/200 usbnet: remove generic hard_header_len check
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Emil Goode <[email protected]>
[ Upstream commit eb85569fe2d06c2fbf4de7b66c263ca095b397aa ]
This patch removes a generic hard_header_len check from the usbnet module that is causing dropped packages under certain circumstances for devices that send rx packets that cross urb boundaries.
One example is the AX88772B which occasionally send rx packets that cross urb boundaries where the remaining partial packet is sent with no hardware header. When the buffer with a partial packet is of less number of octets than the value of hard_header_len the buffer is discarded by the usbnet module.
With AX88772B this can be reproduced by using ping with a packet size between 1965-1976.
The bug has been reported here:
https://bugzilla.kernel.org/show_bug.cgi?id=29082
This patch introduces the following changes:
- Removes the generic hard_header_len check in the rx_complete function in the usbnet module.
- Introduces a ETH_HLEN check for skbs that are not cloned from within a rx_fixup callback.
- For safety a hard_header_len check is added to each rx_fixup callback function that could be affected by this change. These extra checks could possibly be removed by someone who has the hardware to test.
- Removes a call to dev_kfree_skb_any() and instead utilizes the dev->done list to queue skbs for cleanup.
The changes place full responsibility on the rx_fixup callback functions that clone skbs to only pass valid skbs to the usbnet_skb_return function.
--- drivers/net/usb/gl620a.c | 4 ++++ drivers/net/usb/mcs7830.c | 5 +++-- drivers/net/usb/net1080.c | 4 ++++ drivers/net/usb/rndis_host.c | 4 ++++ drivers/net/usb/smsc75xx.c | 4 ++++ drivers/net/usb/smsc95xx.c | 4 ++++ drivers/net/usb/usbnet.c | 25 ++++++++++--------------- 7 files changed, 33 insertions(+), 17 deletions(-)
drivers/net/usb/gl620a.c +4 -0
@@ -86,6 +86,10 @@ static int genelink_rx_fixup(struct usbnet *dev, struct sk_buff *skb)u32 size;u32 count; +/* This check is no longer done by usbnet */ +if (skb->len < dev->net->hard_header_len) +return 0 ; + header = (struct gl_header *) skb->data;// get the packet count of the received skb
drivers/net/usb/mcs7830.c +3 -2
@@ -601,8 +601,9 @@ static int mcs7830_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {u8 status; -if (skb->len ==0 ) { -dev_err (&dev->udev->dev,"unexpected empty rx frame\n" ); +/* This check is no longer done by usbnet */ +if (skb->len < dev->net->hard_header_len) { +dev_err (&dev->udev->dev,"unexpected tiny rx frame\n" );return 0 ; }
drivers/net/usb/net1080.c +4 -0
@@ -419,6 +419,10 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb)struct nc_trailer *trailer;u16 hdr_len, packet_len; +/* This check is no longer done by usbnet */ +if (skb->len < dev->net->hard_header_len) +return 0 ; +if (!(skb->len &0x01 )) {#ifdef DEBUG struct net_device *net = dev->net;
drivers/net/usb/rndis_host.c +4 -0
@@ -490,6 +490,10 @@ EXPORT_SYMBOL_GPL(rndis_unbind);*/ int rndis_rx_fixup (struct usbnet *dev,struct sk_buff *skb) { +/* This check is no longer done by usbnet */ +if (skb->len < dev->net->hard_header_len) +return 0 ; +/* peripheral may have batched packets to us... */ while (likely (skb->len)) {struct rndis_data_hdr *hdr = (void *)skb->data;
drivers/net/usb/smsc75xx.c +4 -0
@@ -1079,6 +1079,10 @@ static void smsc75xx_rx_csum_offload(struct usbnet *dev, struct sk_buff *skb,static int smsc75xx_rx_fixup (struct usbnet *dev,struct sk_buff *skb) { +/* This check is no longer done by usbnet */ +if (skb->len < dev->net->hard_header_len) +return 0 ; +while (skb->len >0 ) {u32 rx_cmd_a, rx_cmd_b, align_count, size;struct sk_buff *ax_skb;
drivers/net/usb/smsc95xx.c +4 -0
@@ -1039,6 +1039,10 @@ static void smsc95xx_rx_csum_offload(struct sk_buff *skb)static int smsc95xx_rx_fixup (struct usbnet *dev,struct sk_buff *skb) { +/* This check is no longer done by usbnet */ +if (skb->len < dev->net->hard_header_len) +return 0 ; +while (skb->len >0 ) {u32 header, align_count;struct sk_buff *ax_skb;
drivers/net/usb/usbnet.c +10 -15
@@ -414,17 +414,19 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) }// else network stack removes extra byte if we forced a short packet -if (skb->len) { -/* all data was already cloned from skb inside the driver */ -if (dev->driver_info->flags &FLAG_MULTI_PACKET ) -dev_kfree_skb_any (skb); -else -usbnet_skb_return (dev, skb); +/* all data was already cloned from skb inside the driver */ +if (dev->driver_info->flags &FLAG_MULTI_PACKET ) + goto done; + +if (skb->len <ETH_HLEN ) { + dev->net->stats.rx_errors++; + dev->net->stats.rx_length_errors++; +netif_dbg (dev, rx_err, dev->net,"rx length %d\n" , skb->len); + }else { +usbnet_skb_return (dev, skb);return ; } -netif_dbg (dev, rx_err, dev->net,"drop\n" ); - dev->net->stats.rx_errors++; done:skb_queue_tail (&dev->done, skb); }
@@ -446,13 +448,6 @@ static void rx_complete (struct urb *urb)switch (urb_status) {/* success */ case 0 : -if (skb->len < dev->net->hard_header_len) { - state = rx_cleanup; - dev->net->stats.rx_errors++; - dev->net->stats.rx_length_errors++; -netif_dbg (dev, rx_err, dev->net, -"rx length %d\n" , skb->len); - }break ;/* stalls need manual reset. this is rare ... except that
PATCH 190/200 bonding: 802.3ad: make aggregator_identifier bond-private
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Bohac <[email protected]>
[ Upstream commit 163c8ff30dbe473abfbb24a7eac5536c87f3baa9 ]
aggregator_identifier is used to assign unique aggregator identifiers to aggregators of a bond during device enslaving.
aggregator_identifier is currently a global variable that is zeroed in bond_3ad_initialize().
This sequence will lead to duplicate aggregator identifiers for eth1 and eth3:
create bond0
change bond0 mode to 802.3ad
enslave eth0 to bond0 //eth0 gets agg id 1
enslave eth1 to bond0 //eth1 gets agg id 2
create bond1
change bond1 mode to 802.3ad
enslave eth2 to bond1 //aggregator_identifier is reset to 0
//eth2 gets agg id 1
enslave eth3 to bond0 //eth3 gets agg id 2
Fix this by making aggregator_identifier private to the bond.
--- drivers/net/bonding/bond_3ad.c | 6 ++---- drivers/net/bonding/bond_3ad.h | 1 + 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/bonding/bond_3ad.c +2 -4
@@ -1854,8 +1854,6 @@ void bond_3ad_initiate_agg_selection(struct bonding *bond, int timeout)BOND_AD_INFO (bond).agg_select_timer = timeout; } -static u16 aggregator_identifier; -/** * bond_3ad_initialize - initialize a bond's 802.3ad parameters and structures * @bond: bonding struct to work on
@@ -1869,7 +1867,7 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)if (MAC_ADDRESS_COMPARE (&(BOND_AD_INFO (bond).system.sys_mac_addr), bond->dev->dev_addr)) { - aggregator_identifier =0 ; +BOND_AD_INFO (bond).aggregator_identifier =0 ;BOND_AD_INFO (bond).system.sys_priority =0xFFFF ;BOND_AD_INFO (bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
@@ -1941,7 +1939,7 @@ int bond_3ad_bind_slave(struct slave *slave)ad_initialize_agg (aggregator); aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr); - aggregator->aggregator_identifier = (++aggregator_identifier); + aggregator->aggregator_identifier = ++BOND_AD_INFO (bond).aggregator_identifier; aggregator->slave = slave; aggregator->is_active =0 ; aggregator->num_of_ports =0 ;
drivers/net/bonding/bond_3ad.h +1 -0
@@ -253,6 +253,7 @@ struct ad_system {struct ad_bond_info {struct ad_system system;/* 802.3ad system structure */ u32 agg_select_timer;// Timer to select aggregator after all adapter's hand shakes +u16 aggregator_identifier; };struct ad_slave_info {
PATCH 191/200 net: sctp: fix sctp_connectx abi for ia32 emulation/compat mode
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit ffd5939381c609056b33b7585fb05a77b4c695f3 ]
SCTP's sctp_connectx() abi breaks for 64bit kernels compiled with 32bit emulation (e.g. ia32 emulation or x86_x32). Due to internal usage of 'struct sctp_getaddrs_old' which includes a struct sockaddr pointer, sizeof(param) check will always fail in kernel as the structure in 64bit kernel space is 4bytes larger than for user binaries compiled in 32bit mode. Thus, applications making use of sctp_connectx() won't be able to run under such circumstances.
Introduce a compat interface in the kernel to deal with such situations by using a 'struct compat_sctp_getaddrs_old' structure where user data is copied into it, and then sucessively transformed into a 'struct sctp_getaddrs_old' structure with the help of compat_ptr(). That fixes sctp_connectx() abi without any changes needed in user space, and lets the SCTP test suite pass when compiled in 32bit and run on 64bit kernels.
--- net/sctp/socket.c | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-)
net/sctp/socket.c +32 -9
@@ -70,6 +70,7 @@#include <linux/init.h> #include <linux/crypto.h> #include <linux/slab.h> +#include <linux/compat.h> #include <net/ip.h> #include <net/icmp.h>
@@ -1376,11 +1377,19 @@ SCTP_STATIC int sctp_setsockopt_connectx(struct sock* sk,/* * New (hopefully final) interface for the API. * We use the sctp_getaddrs_old structure so that use-space library -* can avoid any unnecessary allocations. The only defferent part +* can avoid any unnecessary allocations. The only different part * is that we store the actual length of the address buffer into the -* addrs_num structure member. That way we can re-use the existing +* addrs_num structure member. That way we can re-use the existing * code. */ +#ifdef CONFIG_COMPAT +struct compat_sctp_getaddrs_old { +sctp_assoc_t assoc_id; +s32 addr_num; +compat_uptr_t addrs;/* struct sockaddr * */ +}; +#endif + SCTP_STATIC int sctp_getsockopt_connectx3(struct sock* sk, int len,char __user *optval,int __user *optlen)
@@ -1389,16 +1398,30 @@ SCTP_STATIC int sctp_getsockopt_connectx3(struct sock* sk, int len,sctp_assoc_t assoc_id =0 ;int err =0 ; -if (len <sizeof (param)) -return -EINVAL ; +#ifdef CONFIG_COMPAT +if (is_compat_task ()) { +struct compat_sctp_getaddrs_old param32; -if (copy_from_user (¶m, optval,sizeof (param))) -return -EFAULT ; +if (len <sizeof (param32)) +return -EINVAL ; +if (copy_from_user (¶m32, optval,sizeof (param32))) +return -EFAULT ; - err =__sctp_setsockopt_connectx (sk, - (struct sockaddr __user *)param.addrs, - param.addr_num, &assoc_id); + param.assoc_id = param32.assoc_id; + param.addr_num = param32.addr_num; + param.addrs =compat_ptr (param32.addrs); + } else +#endif + { +if (len <sizeof (param)) +return -EINVAL ; +if (copy_from_user (¶m, optval,sizeof (param))) +return -EFAULT ; + } + err =__sctp_setsockopt_connectx (sk, (struct sockaddr __user *) + param.addrs, param.addr_num, + &assoc_id);if (err ==0 || err == -EINPROGRESS ) {if (copy_to_user (optval, &assoc_id,sizeof (assoc_id)))return -EFAULT ;
PATCH 192/200 cifs: set MAY_SIGN when sec=krb5
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Martijn de Gouw <[email protected]>
commit 0b7bc84000d71f3647ca33ab1bf5bd928535c846 upstream.
Setting this secFlg allows usage of dfs where some servers require signing and others don't.
[Joseph Salisbury: This backport was done so including mainline commit 8830d7e07a5e38bc47650a7554b7c1cfd49902bf is not needed.]
--- fs/cifs/connect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/cifs/connect.c +2 -1
@@ -1113,7 +1113,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,cERROR (1 ,"Krb5 cifs privacy not supported" ); goto cifs_parse_mount_err; }else if (strnicmp (value,"krb5" ,4 ) ==0 ) { - vol->secFlg |=CIFSSEC_MAY_KRB5 ; + vol->secFlg |=CIFSSEC_MAY_KRB5 | +CIFSSEC_MAY_SIGN ; }else if (strnicmp (value,"ntlmsspi" ,8 ) ==0 ) { vol->secFlg |=CIFSSEC_MAY_NTLMSSP |CIFSSEC_MUST_SIGN ;
PATCH 193/200 saa7134: Fix unlocked snd_pcm_stop() call
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit e6355ad7b1c6f70e2f48ae159f5658b441ccff95 upstream.
snd_pcm_stop() must be called in the PCM substream lock context.
--- drivers/media/video/saa7134/saa7134-alsa.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/video/saa7134/saa7134-alsa.c +2 -0
@@ -172,7 +172,9 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev,dprintk ("irq: overrun [full=%d/%d] - Blocks in %d\n" ,dev->dmasound.read_count, dev->dmasound.bufsize, dev->dmasound.blocks);spin_unlock (&dev->slock); +snd_pcm_stream_lock (dev->dmasound.substream);snd_pcm_stop (dev->dmasound.substream,SNDRV_PCM_STATE_XRUN ); +snd_pcm_stream_unlock (dev->dmasound.substream);return ; }
PATCH 194/200 ALSA: oxygen: Xonar DG(X): capture from I2S channel 1, not 2
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Roman Volkov <[email protected]>
commit 3dd77654fb1d7f68b9739f3039bad8dbbc0739f8 upstream.
Actually CS4245 connected to the I2S channel 1 for capture, not channel 2. Otherwise capturing and playback does not work for CS4245.
--- sound/pci/oxygen/xonar_dg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/oxygen/xonar_dg.c +1 -1
@@ -597,7 +597,7 @@ struct oxygen_model model_xonar_dg = { .model_data_size = sizeof(struct dg), .device_config =PLAYBACK_0_TO_I2S |PLAYBACK_1_TO_SPDIF | - CAPTURE_0_FROM_I2S_2, + CAPTURE_0_FROM_I2S_1, .dac_channels_pcm = 6, .dac_channels_mixer = 0, .function_flags = OXYGEN_FUNCTION_SPI,
PATCH 195/200 ALSA: oxygen: Xonar DG(X): modify DAC routing
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Ladisch <[email protected]>
commit 1f91ecc14deea9461aca93273d78871ec4d98fcd upstream.
When selecting the audio output destinations (headphones, FP headphones, multichannel output), unnecessary I2S channels are digitally muted to avoid invalid signal levels on the other outputs.
--- sound/pci/oxygen/xonar_dg.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/pci/oxygen/xonar_dg.c +10 -0
@@ -294,6 +294,16 @@ static int output_switch_put(struct snd_oxygen_write16_masked (chip,OXYGEN_GPIO_DATA , data->output_sel ==1 ?GPIO_HP_REAR :0 ,GPIO_HP_REAR ); +oxygen_write8_masked (chip,OXYGEN_PLAY_ROUTING , + data->output_sel ==0 ? +OXYGEN_PLAY_MUTE01 : +OXYGEN_PLAY_MUTE23 | +OXYGEN_PLAY_MUTE45 | +OXYGEN_PLAY_MUTE67 , +OXYGEN_PLAY_MUTE01 | +OXYGEN_PLAY_MUTE23 | +OXYGEN_PLAY_MUTE45 | +OXYGEN_PLAY_MUTE67 ); }mutex_unlock (&chip->mutex);return changed;
PATCH 196/200 jiffies: Avoid undefined behavior from signed overflow
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "Paul E. McKenney" <[email protected]>
commit 5a581b367b5df0531265311fc681c2abd377e5e6 upstream.
According to the C standard 3.4.3p3, overflow of a signed integer results in undefined behavior. This commit therefore changes the definitions of time_after(), time_after_eq(), time_after64(), and time_after_eq64() to avoid this undefined behavior. The trick is that the subtraction is done using unsigned arithmetic, which according to 6.2.5p9 cannot overflow because it is defined as modulo arithmetic. This has the added (though admittedly quite small) benefit of shortening four lines of code by four characters each.
Note that the C standard considers the cast from unsigned to signed to be implementation-defined, see 6.3.1.3p3. However, on a two's-complement system, an implementation that defines anything other than a reinterpretation of the bits is free to come to me, and I will be happy to act as a witness for its being committed to an insane asylum. (Although I have nothing against saturating arithmetic or signals in some cases, these things really should not be the default when compiling an operating-system kernel.)
[ paulmck: Included time_after64() and time_after_eq64(), as suggested
by Eric Dumazet, also fixed commit message.]
--- include/linux/jiffies.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/jiffies.h +4 -4
@@ -106,13 +106,13 @@ static inline u64 get_jiffies_64(void)#define time_after (a,b) \ (typecheck(unsigned long, a) && \ typecheck(unsigned long, b) && \ - ((long)(b) - (long)(a) < 0)) + ((long)((b) - (a)) < 0))#define time_before (a,b) time_after(b,a)#define time_after_eq (a,b) \ (typecheck(unsigned long, a) && \ typecheck(unsigned long, b) && \ - ((long)(a) - (long)(b) >= 0)) + ((long)((a) - (b)) >= 0))#define time_before_eq (a,b) time_after_eq(b,a)/*
@@ -135,13 +135,13 @@ static inline u64 get_jiffies_64(void)#define time_after64 (a,b) \ (typecheck(__u64, a) && \ typecheck(__u64, b) && \ - ((__s64)(b) - (__s64)(a) < 0)) + ((__s64)((b) - (a)) < 0))#define time_before64 (a,b) time_after64(b,a)#define time_after_eq64 (a,b) \ (typecheck(__u64, a) && \ typecheck(__u64, b) && \ - ((__s64)(a) - (__s64)(b) >= 0)) + ((__s64)((a) - (b)) >= 0))#define time_before_eq64 (a,b) time_after_eq64(b,a)/*
PATCH 197/200 virtio-net: alloc big buffers also when guest can receive UFO
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jason Wang <[email protected]>
[ Upstream commit 0e7ede80d929ff0f830c44a543daa1acd590c749 ]
We should alloc big buffers also when guest can receive UFO packets to let the big packets fit into guest rx buffer.
Fixes 5c5167515d80f78f6bb538492c423adcae31ad65 (virtio-net: Allow UFO feature to be set and advertised.)
--- drivers/net/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/virtio_net.c +2 -1
@@ -1029,7 +1029,8 @@ static int virtnet_probe(struct virtio_device *vdev)/* If we can receive ANY GSO packets, we must allocate large ones. */ if (virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_TSO4 ) ||virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_TSO6 ) || -virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_ECN )) +virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_ECN ) || +virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_UFO )) vi->big_packets = true;if (virtio_has_feature (vdev,VIRTIO_NET_F_MRG_RXBUF ))
PATCH 198/200 tg3: Don't check undefined error bits in RXBD
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Michael Chan <[email protected]>
[ Upstream commit d7b95315cc7f441418845a165ee56df723941487 ]
Redefine the RXD_ERR_MASK to include only relevant error bits. This fixes a customer reported issue of randomly dropping packets on the 5719.
--- drivers/net/ethernet/broadcom/tg3.c | 3 +-- drivers/net/ethernet/broadcom/tg3.h | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +1 -2
@@ -5637,8 +5637,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) work_mask |= opaque_key; -if ((desc->err_vlan &RXD_ERR_MASK ) !=0 && - (desc->err_vlan !=RXD_ERR_ODD_NIBBLE_RCVD_MII )) { +if (desc->err_vlan &RXD_ERR_MASK ) { drop_it:tg3_recycle_rx (tnapi, tpr, opaque_key, desc_idx, *post_ptr);
drivers/net/ethernet/broadcom/tg3.h +5 -1
@@ -2477,7 +2477,11 @@ struct tg3_rx_buffer_desc {#define RXD_ERR_TOO_SMALL 0x00400000#define RXD_ERR_NO_RESOURCES 0x00800000#define RXD_ERR_HUGE_FRAME 0x01000000 -#define RXD_ERR_MASK 0xffff0000 + +#define RXD_ERR_MASK (RXD_ERR_BAD_CRC | RXD_ERR_COLLISION | \ + RXD_ERR_LINK_LOST | RXD_ERR_PHY_DECODE | \ + RXD_ERR_MAC_ABRT | RXD_ERR_TOO_SMALL | \ + RXD_ERR_NO_RESOURCES | RXD_ERR_HUGE_FRAME)u32 reserved;u32 opaque;
PATCH 199/200 net: sctp: fix sctp_sf_do_5_1D_ce to verify if we/peer is AUTH capable
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit ec0223ec48a90cb605244b45f7c62de856403729 ]
RFC4895 introduced AUTH chunks for SCTP; during the SCTP handshake RANDOM; CHUNKS; HMAC-ALGO are negotiated (CHUNKS being optional though):
---------- INIT[RANDOM; CHUNKS; HMAC-ALGO] ----------> <------- INIT-ACK[RANDOM; CHUNKS; HMAC-ALGO] --------- -------------------- COOKIE-ECHO --------------------> <-------------------- COOKIE-ACK ---------------------
A special case is when an endpoint requires COOKIE-ECHO chunks to be authenticated:
---------- INIT[RANDOM; CHUNKS; HMAC-ALGO] ----------> <------- INIT-ACK[RANDOM; CHUNKS; HMAC-ALGO] --------- ------------------ AUTH; COOKIE-ECHO ----------------> <-------------------- COOKIE-ACK ---------------------
RFC4895, section 6.3. Receiving Authenticated Chunks says:
The receiver MUST use the HMAC algorithm indicated in the HMAC Identifier field. If this algorithm was not specified by the receiver in the HMAC-ALGO parameter in the INIT or INIT-ACK chunk during association setup, the AUTH chunk and all the chunks after it MUST be discarded and an ERROR chunk SHOULD be sent with the error cause defined in Section 4.1. [...] If no endpoint pair shared key has been configured for that Shared Key Identifier, all authenticated chunks MUST be silently discarded. [...]
When an endpoint requires COOKIE-ECHO chunks to be authenticated, some special procedures have to be followed because the reception of a COOKIE-ECHO chunk might result in the creation of an SCTP association. If a packet arrives containing an AUTH chunk as a first chunk, a COOKIE-ECHO chunk as the second chunk, and possibly more chunks after them, and the receiver does not have an STCB for that packet, then authentication is based on the contents of the COOKIE-ECHO chunk. In this situation, the receiver MUST authenticate the chunks in the packet by using the RANDOM parameters, CHUNKS parameters and HMAC_ALGO parameters obtained from the COOKIE-ECHO chunk, and possibly a local shared secret as inputs to the authentication procedure specified in Section 6.3. If authentication fails, then the packet is discarded. If the authentication is successful, the COOKIE-ECHO and all the chunks after the COOKIE-ECHO MUST be processed. If the receiver has an STCB, it MUST process the AUTH chunk as described above using the STCB from the existing association to authenticate the COOKIE-ECHO chunk and all the chunks after it. [...]
Commit bbd0d59809f9 introduced the possibility to receive and verification of AUTH chunk, including the edge case for authenticated COOKIE-ECHO. On reception of COOKIE-ECHO, the function sctp_sf_do_5_1D_ce() handles processing, unpacks and creates a new association if it passed sanity checks and also tests for authentication chunks being present. After a new association has been processed, it invokes sctp_process_init() on the new association and walks through the parameter list it received from the INIT chunk. It checks SCTP_PARAM_RANDOM, SCTP_PARAM_HMAC_ALGO and SCTP_PARAM_CHUNKS, and copies them into asoc->peer meta data (peer_random, peer_hmacs, peer_chunks) in case sysctl -w net.sctp.auth_enable=1 is set. If in INIT's SCTP_PARAM_SUPPORTED_EXT parameter SCTP_CID_AUTH is set, peer_random != NULL and peer_hmacs != NULL the peer is to be assumed asoc->peer.auth_capable=1, in any other case asoc->peer.auth_capable=0.
Now, if in sctp_sf_do_5_1D_ce() chunk->auth_chunk is available, we set up a fake auth chunk and pass that on to sctp_sf_authenticate(), which at latest in sctp_auth_calculate_hmac() reliably dereferences a NULL pointer at position 0..0008 when setting up the crypto key in crypto_hash_setkey() by using asoc->asoc_shared_key that is NULL as condition key_id == asoc->active_key_id is true if the AUTH chunk was injected correctly from remote. This happens no matter what net.sctp.auth_enable sysctl says.
The fix is to check for net->sctp.auth_enable and for asoc->peer.auth_capable before doing any operations like sctp_sf_authenticate() as no key is activated in sctp_auth_asoc_init_active_key() for each case.
Now as RFC4895 section 6.3 states that if the used HMAC-ALGO passed from the INIT chunk was not used in the AUTH chunk, we SHOULD send an error; however in this case it would be better to just silently discard such a maliciously prepared handshake as we didn't even receive a parameter at all. Also, as our endpoint has no shared key configured, section 6.3 says that MUST silently discard, which we are doing from now onwards.
Before calling sctp_sf_pdiscard(), we need not only to free the association, but also the chunk->auth_chunk skb, as commit bbd0d59809f9 created a skb clone in that case.
I have tested this locally by using netfilter's nfqueue and re-injecting packets into the local stack after maliciously modifying the INIT chunk (removing RANDOM; HMAC-ALGO param) and the SCTP packet containing the COOKIE_ECHO (injecting AUTH chunk before COOKIE_ECHO). Fixed with this patch applied.
--- net/sctp/sm_statefuns.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/sctp/sm_statefuns.c +7 -0
@@ -747,6 +747,13 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,struct sctp_chunk auth;sctp_ierror_t ret; +/* Make sure that we and the peer are AUTH capable */ +if (!sctp_auth_enable || !new_asoc->peer.auth_capable) { +kfree_skb (chunk->auth_chunk); +sctp_association_free (new_asoc); +return sctp_sf_pdiscard (ep, asoc, type, arg, commands); + } +/* set-up our fake chunk so that we can process it */ auth.skb = chunk->auth_chunk; auth.asoc = chunk->asoc;
PATCH 200/200 intel_idle: Check cpu_idle_get_driver() for NULL before dereferencing it.
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Rzeszutek Wilk <[email protected]>
commit 3735d524da64b70b41c764359da36f88aded3610 upstream.
If the machine is booted without any cpu_idle driver set (b/c disable_cpuidle() has been called) we should follow other users of cpu_idle API and check the return value for NULL before using it.
--- drivers/idle/intel_idle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/idle/intel_idle.c +2 -1
@@ -584,8 +584,9 @@ static int __init intel_idle_init(void)intel_idle_cpuidle_driver_init (); retval =cpuidle_register_driver (&intel_idle_driver);if (retval) { +struct cpuidle_driver *drv =cpuidle_get_driver (); printk(KERN_DEBUG PREFIX "intel_idle yielding to %s", - cpuidle_get_driver()->name); + drv ? drv->name : "none");return retval; }
This is the combined patch for 3.2.56-rc1 relative to 3.2.55.
Ben.
Signature · 2 lines
Ben Hutchings friends: People who know you well, but like you anyway.
Documentation/filesystems/proc.txt +2 -2
@@ -1293,8 +1293,8 @@ may allocate from based on an estimation of its current memory and swap use. For example, if a task is using all allowed memory, its badness score will be 1000. If it is using half of its allowed memory, its score will be 500. -There is an additional factor included in the badness score: root -processes are given 3% extra memory over other tasks. +There is an additional factor included in the badness score: the current memory +and swap usage is discounted by 3% for root processes. The amount of "allowed" memory depends on the context in which the oom killer was called. If it is due to the memory assigned to the allocating task's cpuset
Documentation/i2c/busses/i2c-piix4 +1 -1
@@ -8,7 +8,7 @@ Supported adapters: Datasheet: Only available via NDA from ServerWorks * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges Datasheet: Not publicly available - * AMD Hudson-2, CZ + * AMD Hudson-2, ML, CZ Datasheet: Not publicly available * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge Datasheet: Publicly available at the SMSC website http://www.smsc.com
Makefile +2 -2
@@ -1,7 +1,7 @@ VERSION = 3 PATCHLEVEL = 2 -SUBLEVEL = 55 -EXTRAVERSION = +SUBLEVEL = 56 +EXTRAVERSION = -rc1 NAME = Saber-toothed Squirrel # *DOCUMENTATION*
arch/alpha/lib/csum_partial_copy.c +7 -2
@@ -373,6 +373,11 @@ csum_partial_copy_from_user(const void __user *src, void *dst, int len,__wsum csum_partial_copy_nocheck (const void *src,void *dst,int len,__wsum sum) { -return csum_partial_copy_from_user ((__force const void __user *)src, - dst, len, sum,NULL ); +__wsum checksum; +mm_segment_t oldfs =get_fs (); +set_fs (KERNEL_DS ); + checksum =csum_partial_copy_from_user ((__force const void __user *)src, + dst, len, sum,NULL ); +set_fs (oldfs); +return checksum; }
arch/arm/include/asm/cacheflush.h +1 -0
@@ -202,6 +202,7 @@ extern void copy_to_user_page(struct vm_area_struct *, struct page *,static inline void __flush_icache_all (void ) {__flush_icache_preferred (); +dsb (); }#define flush_cache_all () __cpuc_flush_kern_all()
arch/arm/include/asm/spinlock.h +3 -12
@@ -44,18 +44,9 @@static inline void dsb_sev (void ) { -#if __LINUX_ARM_ARCH__ >=7 - __asm__ __volatile__ ( -"dsb\n" -SEV - ); -#else - __asm__ __volatile__ ( -"mcr p15, 0, %0, c7, c10, 4\n" -SEV - : :"r" (0 ) - ); -#endif + +dsb (); + __asm__(SEV); }/*
arch/arm/mm/proc-v6.S +2 -1
@@ -199,7 +199,6 @@ __v6_setup: mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache - mcr p15, 0, r0, c7, c10, 4 @ drain write buffer #ifdef CONFIG_MMU mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs mcr p15, 0, r0, c2, c0, 2 @ TTB control register
@@ -209,6 +208,8 @@ __v6_setup: ALT_UP(orr r8, r8, #TTB_FLAGS_UP) mcr p15, 0, r8, c2, c0, 1 @ load TTB1 #endif /* CONFIG_MMU */ + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer and + @ complete invalidations adr r5, v6_crval ldmia r5, {r5, r6} #ifdef CONFIG_CPU_ENDIAN_BE8
arch/arm/mm/proc-v7.S +1 -1
@@ -368,7 +368,6 @@ __v7_setup: 3: mov r10, #0 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate - dsb #ifdef CONFIG_MMU mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs mcr p15, 0, r10, c2, c0, 2 @ TTB control register
@@ -382,6 +381,7 @@ __v7_setup: mcr p15, 0, r5, c10, c2, 0 @ write PRRR mcr p15, 0, r6, c10, c2, 1 @ write NMRR #endif + dsb @ Complete invalidations #ifndef CONFIG_ARM_THUMBEE mrc p15, 0, r0, c0, c1, 0 @ read ID_PFR0 for ThumbEE and r0, r0, #(0xf << 12) @ ThumbEE enabled field
arch/avr32/Makefile +1 -1
@@ -11,7 +11,7 @@ all: uImage vmlinux.elf KBUILD_DEFCONFIG := atstk1002_defconfig -KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic +KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic -D__linux__ KBUILD_AFLAGS += -mrelax -mno-pic KBUILD_CFLAGS_MODULE += -mno-relax LDFLAGS_vmlinux += --relax
arch/avr32/boards/mimc200/fram.c +1 -0
@@ -11,6 +11,7 @@#define FRAM_VERSION "1.0"#include <linux/miscdevice.h> +#include <linux/module.h> #include <linux/proc_fs.h> #include <linux/mm.h> #include <linux/io.h>
arch/mips/mm/c-r4k.c +0 -11
@@ -633,9 +633,6 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)if (size >= scache_size)r4k_blast_scache ();else { -unsigned long lsize =cpu_scache_line_size (); -unsigned long almask = ~(lsize -1 ); -/* * There is no clearly documented alignment requirement * for the cache instruction on MIPS processors and
@@ -644,9 +641,6 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)* hit ops with insufficient alignment. Solved by * aligning the address to cache line size. */ -cache_op (Hit_Writeback_Inv_SD, addr & almask); -cache_op (Hit_Writeback_Inv_SD, - (addr + size -1 ) & almask);blast_inv_scache_range (addr, addr + size); }__sync ();
@@ -656,12 +650,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)if (cpu_has_safe_index_cacheops && size >= dcache_size) {r4k_blast_dcache (); }else { -unsigned long lsize =cpu_dcache_line_size (); -unsigned long almask = ~(lsize -1 ); -R4600_HIT_CACHEOP_WAR_IMPL ; -cache_op (Hit_Writeback_Inv_D, addr & almask); -cache_op (Hit_Writeback_Inv_D, (addr + size -1 ) & almask);blast_inv_dcache_range (addr, addr + size); }
arch/powerpc/kernel/cacheinfo.c +3 -0
@@ -788,6 +788,9 @@ static void remove_cache_dir(struct cache_dir *cache_dir) {remove_index_dirs (cache_dir); +/* Remove cache dir from sysfs */ +kobject_del (cache_dir->kobj); +kobject_put (cache_dir->kobj);kfree (cache_dir);
arch/powerpc/kernel/crash_dump.c +5 -3
@@ -108,17 +108,19 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, size_t csize, unsigned long offset, int userbuf) { void *vaddr; +phys_addr_t paddr;if (!csize)return 0 ; csize =min_t (size_t, csize,PAGE_SIZE ); + paddr = pfn <<PAGE_SHIFT ; -if ((min_low_pfn < pfn) && (pfn < max_pfn)) { - vaddr =__va (pfn <<PAGE_SHIFT ); +if (memblock_is_region_memory (paddr, csize)) { + vaddr =__va (paddr); csize =copy_oldmem_vaddr (vaddr, buf, csize, offset, userbuf); }else { - vaddr =__ioremap (pfn <<PAGE_SHIFT ,PAGE_SIZE ,0 ); + vaddr =__ioremap (paddr,PAGE_SIZE ,0 ); csize =copy_oldmem_vaddr (vaddr, buf, csize, offset, userbuf);iounmap (vaddr); }
arch/powerpc/kernel/reloc_64.S +1 -0
@@ -81,6 +81,7 @@ _GLOBAL(relocate) 6: blr +.balign 8 p_dyn: .llong __dynamic_start - 0b p_rela: .llong __rela_dyn_start - 0b p_st: .llong _stext - 0b
arch/powerpc/kvm/e500_tlb.c +1 -1
@@ -481,7 +481,7 @@ static inline void kvmppc_e500_priv_release(struct tlbe_priv *priv) }static inline void kvmppc_e500_deliver_tlb_miss (struct kvm_vcpu *vcpu, -unsigned int eaddr,int as) +gva_t eaddr,int as) {struct kvmppc_vcpu_e500 *vcpu_e500 =to_e500 (vcpu);unsigned int victim, pidsel, tsized;
arch/powerpc/platforms/pseries/hotplug-cpu.c +11 -11
@@ -35,12 +35,7 @@#include "offline_states.h" /* This version can't take the spinlock, because it never returns */ -static struct rtas_args rtas_stop_self_args = { - .token =RTAS_UNKNOWN_SERVICE , - .nargs =0 , - .nret =1 , - .rets = &rtas_stop_self_args.args[0 ], -}; +static int rtas_stop_self_token =RTAS_UNKNOWN_SERVICE ; static DEFINE_PER_CPU(enum cpu_state_vals, preferred_offline_state) =CPU_STATE_OFFLINE ;
@@ -93,15 +88,20 @@ void set_default_offline_state(int cpu)static void rtas_stop_self (void ) { -struct rtas_args *args = &rtas_stop_self_args; +struct rtas_args args = { + .token =cpu_to_be32 (rtas_stop_self_token), + .nargs =0 , + .nret =1 , + .rets = &args.args[0 ], + };local_irq_disable (); -BUG_ON (args->token ==RTAS_UNKNOWN_SERVICE ); +BUG_ON (rtas_stop_self_token ==RTAS_UNKNOWN_SERVICE );printk ("cpu %u (hwid %u) Ready to die...\n" ,smp_processor_id (),hard_smp_processor_id ()); -enter_rtas (__pa (args)); +enter_rtas (__pa (&args));panic ("Alas, I survived.\n" ); }
@@ -384,10 +384,10 @@ static int __init pseries_cpu_hotplug_init(void) } } - rtas_stop_self_args.token =rtas_token ("stop-self" ); + rtas_stop_self_token =rtas_token ("stop-self" ); qcss_tok =rtas_token ("query-cpu-stopped-state" ); -if (rtas_stop_self_args.token ==RTAS_UNKNOWN_SERVICE || +if (rtas_stop_self_token ==RTAS_UNKNOWN_SERVICE || qcss_tok ==RTAS_UNKNOWN_SERVICE ) {printk (KERN_INFO "CPU Hotplug not supported by firmware " "- disabling.\n" );
arch/s390/crypto/aes_s390.c +56 -23
151 lines not on this page · raw message
arch/s390/crypto/des_s390.c +68 -35
205 lines not on this page · raw message
arch/s390/crypto/ghash_s390.c +13 -8
@@ -72,14 +72,16 @@ static int ghash_update(struct shash_desc *desc,if (!dctx->bytes) { ret =crypt_s390_kimd (KIMD_GHASH , ctx, buf,GHASH_BLOCK_SIZE ); -BUG_ON (ret !=GHASH_BLOCK_SIZE ); +if (ret !=GHASH_BLOCK_SIZE ) +return -EIO ; } } n = srclen & ~(GHASH_BLOCK_SIZE -1 );if (n) { ret =crypt_s390_kimd (KIMD_GHASH , ctx, src, n); -BUG_ON (ret != n); +if (ret != n) +return -EIO ; src += n; srclen -= n; }
@@ -92,7 +94,7 @@ static int ghash_update(struct shash_desc *desc,return 0 ; } -static void ghash_flush (struct ghash_ctx *ctx,struct ghash_desc_ctx *dctx) +static int ghash_flush (struct ghash_ctx *ctx,struct ghash_desc_ctx *dctx) {u8 *buf = dctx->buffer;int ret;
@@ -103,21 +105,24 @@ static void ghash_flush(struct ghash_ctx *ctx, struct ghash_desc_ctx *dctx)memset (pos,0 , dctx->bytes); ret =crypt_s390_kimd (KIMD_GHASH , ctx, buf,GHASH_BLOCK_SIZE ); -BUG_ON (ret !=GHASH_BLOCK_SIZE ); +if (ret !=GHASH_BLOCK_SIZE ) +return -EIO ; } dctx->bytes =0 ; +return 0 ; }static int ghash_final (struct shash_desc *desc,u8 *dst) {struct ghash_desc_ctx *dctx =shash_desc_ctx (desc);struct ghash_ctx *ctx =crypto_shash_ctx (desc->tfm); +int ret; -ghash_flush (ctx, dctx); -memcpy (dst, ctx->icv,GHASH_BLOCK_SIZE ); - -return 0 ; + ret =ghash_flush (ctx, dctx); +if (!ret) +memcpy (dst, ctx->icv,GHASH_BLOCK_SIZE ); +return ret; }static struct shash_alg ghash_alg = {
arch/s390/crypto/sha_common.c +6 -3
@@ -36,7 +36,8 @@ int s390_sha_update(struct shash_desc *desc, const u8 *data, unsigned int len)if (index) {memcpy (ctx->buf + index, data, bsize - index); ret =crypt_s390_kimd (ctx->func, ctx->state, ctx->buf, bsize); -BUG_ON (ret != bsize); +if (ret != bsize) +return -EIO ; data += bsize - index; len -= bsize - index; index =0 ;
@@ -46,7 +47,8 @@ int s390_sha_update(struct shash_desc *desc, const u8 *data, unsigned int len)if (len >= bsize) { ret =crypt_s390_kimd (ctx->func, ctx->state, data, len & ~(bsize -1 )); -BUG_ON (ret != (len & ~(bsize -1 ))); +if (ret != (len & ~(bsize -1 ))) +return -EIO ; data += ret; len -= ret; }
@@ -88,7 +90,8 @@ int s390_sha_final(struct shash_desc *desc, u8 *out)memcpy (ctx->buf + end -8 , &bits,sizeof (bits)); ret =crypt_s390_kimd (ctx->func, ctx->state, ctx->buf, end); -BUG_ON (ret != end); +if (ret != end) +return -EIO ;/* copy digest to out */ memcpy (out, ctx->state,crypto_shash_digestsize (desc->tfm));
arch/s390/mm/page-states.c +10 -0
@@ -12,6 +12,8 @@#include <linux/mm.h> #include <linux/gfp.h> #include <linux/init.h> +#include <asm/setup.h> +#include <asm/ipl.h> #define ESSA_SET_STABLE 1#define ESSA_SET_UNUSED 2
@@ -41,6 +43,14 @@ void __init cmma_init(void)if (!cmma_flag)return ; +/* +* Disable CMM for dump, otherwise the tprot based memory +* detection can fail because of unstable pages. +*/ +if (OLDMEM_BASE || ipl_info.type ==IPL_TYPE_FCP_DUMP ) { + cmma_flag =0 ; +return ; + } asmvolatile (" .insn rrf,0xb9ab0000,%1,%1,0,0\n" "0: la %0,0\n"
arch/x86/include/asm/irq.h +1 -0
@@ -25,6 +25,7 @@ extern void irq_ctx_init(int cpu);#ifdef CONFIG_HOTPLUG_CPU #include <linux/cpumask.h> +extern int check_irq_vectors_for_cpu_disable (void );extern void fixup_irqs (void );extern void irq_force_complete_move (int );#endif
arch/x86/kernel/cpu/perf_event.c +3 -0
@@ -971,6 +971,9 @@ static void x86_pmu_del(struct perf_event *event, int flags)for (i =0 ; i < cpuc->n_events; i++) {if (event == cpuc->event_list[i]) { +if (i >= cpuc->n_events - cpuc->n_added) + --cpuc->n_added; +if (x86_pmu.put_event_constraints) x86_pmu.put_event_constraints (cpuc, event);
arch/x86/kernel/irq.c +70 -0
76 lines not on this page · raw message
arch/x86/kernel/quirks.c +1 -1
@@ -525,7 +525,7 @@ static void __init quirk_amd_nb_node(struct pci_dev *dev)return ;pci_read_config_dword (nb_ht,0x60 , &val); - node = val &7 ; + node =pcibus_to_node (dev->bus) | (val &7 );/* * Some hardware may return an invalid node ID, * so check it first:
arch/x86/kernel/smpboot.c +5 -0
@@ -1278,6 +1278,7 @@ void cpu_disable_common(void)int native_cpu_disable (void ) {int cpu =smp_processor_id (); +int ret;/* * Perhaps use cpufreq to drop frequency, but that could go
@@ -1290,6 +1291,10 @@ int native_cpu_disable(void)if (cpu ==0 )return -EBUSY ; + ret =check_irq_vectors_for_cpu_disable (); +if (ret) +return ret; +clear_local_APIC ();cpu_disable_common ();
arch/x86/kvm/i8254.c +18 -0
@@ -38,6 +38,7 @@#include "irq.h" #include "i8254.h" +#include "x86.h" #ifndef CONFIG_X86_64 #define mod_64 (x, y) ((x) - (y) * div64_u64(x, y))
@@ -364,6 +365,23 @@ static void create_pit_timer(struct kvm *kvm, u32 val, int is_period)atomic_set (&pt->pending,0 ); ps->irq_ack =1 ; +/* +* Do not allow the guest to program periodic timers with small +* interval, since the hrtimers are not throttled by the host +* scheduler. +*/ +if (ps->is_periodic) { +s64 min_period = min_timer_period_us *1000LL ; + +if (pt->period < min_period) { +pr_info_ratelimited ( +"kvm: requested %lld ns " +"i8254 timer period limited to %lld ns\n" , + pt->period, min_period); + pt->period = min_period; + } + } +hrtimer_start (&pt->timer,ktime_add_ns (ktime_get (), interval),HRTIMER_MODE_ABS ); }
arch/x86/kvm/lapic.c +0 -3
@@ -68,9 +68,6 @@#define VEC_POS (v) ((v) & (32 - 1))#define REG_POS (v) (((v) >> 5) << 4) -static unsigned int min_timer_period_us =500 ; -module_param (min_timer_period_us, uint,S_IRUGO |S_IWUSR ); -static inline u32 apic_get_reg (struct kvm_lapic *apic,int reg_off) {return *((u32 *) (apic->regs + reg_off));
arch/x86/kvm/svm.c +3 -3
@@ -2904,10 +2904,8 @@ static int cr8_write_interception(struct vcpu_svm *svm)u8 cr8_prev =kvm_get_cr8 (&svm->vcpu);/* instruction emulation calls kvm_set_cr8() */ r =cr_interception (svm); -if (irqchip_in_kernel (svm->vcpu.kvm)) { -clr_cr_intercept (svm,INTERCEPT_CR8_WRITE ); +if (irqchip_in_kernel (svm->vcpu.kvm))return r; - }if (cr8_prev <=kvm_get_cr8 (&svm->vcpu))return r; kvm_run->exit_reason =KVM_EXIT_SET_TPR ;
@@ -3462,6 +3460,8 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr)if (is_guest_mode (vcpu) && (vcpu->arch.hflags &HF_VINTR_MASK ))return ; +clr_cr_intercept (svm,INTERCEPT_CR8_WRITE ); +if (irr ==-1 )return ;
arch/x86/kvm/x86.c +3 -0
@@ -92,6 +92,9 @@ EXPORT_SYMBOL_GPL(kvm_x86_ops);int ignore_msrs =0 ;module_param_named (ignore_msrs, ignore_msrs, bool,S_IRUGO |S_IWUSR ); +unsigned int min_timer_period_us =500 ; +module_param (min_timer_period_us, uint,S_IRUGO |S_IWUSR ); +bool kvm_has_tsc_control;EXPORT_SYMBOL_GPL (kvm_has_tsc_control);u32 kvm_max_guest_tsc_khz;
arch/x86/kvm/x86.h +2 -0
@@ -125,4 +125,6 @@ int kvm_write_guest_virt_system(struct x86_emulate_ctxt *ctxt, gva_t addr, void *val, unsigned int bytes, struct x86_exception *exception); +extern unsigned int min_timer_period_us; +#endif
arch/x86/platform/efi/efi.c +1 -1
@@ -424,7 +424,7 @@ void __init efi_reserve_boot_services(void)* - Not within any part of the kernel * - Not the bios reserved area */ -if ((start+size >=virt_to_phys (_text) +if ((start + size >virt_to_phys (_text) && start <=virt_to_phys (_end)) || !e820_all_mapped (start, start+size,E820_RAM ) || memblock_x86_check_reserved_size(&start, &size,
block/blk-lib.c +8 -0
@@ -101,6 +101,14 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,atomic_inc (&bb.done);submit_bio (type, bio); + +/* +* We can loop for a long time in here, if someone does +* full device discards (like mkfs). Be nice and allow +* us to schedule out to avoid softlocking if preempt +* is disabled. +*/ +cond_resched (); }/* Wait for bios in-flight */
drivers/acpi/bus.c +9 -0
@@ -33,6 +33,7 @@#include <linux/proc_fs.h> #include <linux/acpi.h> #include <linux/slab.h> +#include <linux/regulator/machine.h> #ifdef CONFIG_X86 #include <asm/mpspec.h> #endif
@@ -917,6 +918,14 @@ void __init acpi_early_init(void) goto error0; } +/* +* If the system is using ACPI then we can be reasonably +* confident that any regulators are managed by the firmware +* so tell the regulator core it has everything it needs to +* know. +*/ +regulator_has_full_constraints (); +return ; error0:
drivers/acpi/ec.c +64 -0
106 lines not on this page · raw message
drivers/acpi/processor_throttling.c +32 -37
136 lines not on this page · raw message
drivers/acpi/video.c +7 -1
@@ -646,6 +646,7 @@ acpi_video_init_brightness(struct acpi_video_device *device)union acpi_object *o;struct acpi_video_device_brightness *br =NULL ;int result = -EINVAL ; +u32 value;if (!ACPI_SUCCESS (acpi_video_device_lcd_query_levels (device, &obj))) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Could not query available "
@@ -676,7 +677,12 @@ acpi_video_init_brightness(struct acpi_video_device *device) printk(KERN_ERR PREFIX "Invalid data\n");continue ; } - br->levels[count] = (u32 ) o->integer.value; + value = (u32 ) o->integer.value; +/* Skip duplicate entries */ +if (count >2 && br->levels[count -1 ] == value) +continue ; + + br->levels[count] = value;if (br->levels[count] > max_level) max_level = br->levels[count];
drivers/ata/ahci.c +14 -0
@@ -61,6 +61,7 @@ enum board_ids {/* board IDs by feature in alphabetical order */ board_ahci, board_ahci_ign_iferr, + board_ahci_noncq, board_ahci_nosntf, board_ahci_yes_fbs,
@@ -123,6 +124,13 @@ static const struct ata_port_info ahci_port_info[] = { .udma_mask = ATA_UDMA6, .port_ops = &ahci_ops, }, + [board_ahci_noncq] = { + AHCI_HFLAGS (AHCI_HFLAG_NO_NCQ), + .flags = AHCI_FLAG_COMMON, + .pio_mask = ATA_PIO4, + .udma_mask = ATA_UDMA6, + .port_ops = &ahci_ops, + }, [board_ahci_nosntf] = { AHCI_HFLAGS (AHCI_HFLAG_NO_SNTF),
@@ -458,6 +466,12 @@ static const struct pci_device_id ahci_pci_tbl[] = { { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */ { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */ +/* +* Samsung SSDs found on some macbooks. NCQ times out. +* https://bugzilla.kernel.org/show_bug.cgi?id=60731 +*/ + { PCI_VDEVICE(SAMSUNG, 0x1600), board_ahci_noncq }, +/* Enmotus */ { PCI_DEVICE(0x1c44, 0x8000), board_ahci },
drivers/ata/libata-core.c +28 -0
@@ -2188,6 +2188,16 @@ int ata_dev_configure(struct ata_device *dev)if (rc)return rc; +/* some WD SATA-1 drives have issues with LPM, turn on NOLPM for them */ +if ((dev->horkage &ATA_HORKAGE_WD_BROKEN_LPM ) && + (id[76 ] &0xe ) ==0x2 ) + dev->horkage |=ATA_HORKAGE_NOLPM ; + +if (dev->horkage &ATA_HORKAGE_NOLPM ) { +ata_dev_warn (dev,"LPM support broken, forcing max_power\n" ); + dev->link->ap->target_lpm_policy =ATA_LPM_MAX_POWER ; + } +/* let ACPI work its magic */ rc =ata_acpi_on_devcfg (dev);if (rc)
@@ -4099,6 +4109,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {/* Seagate Momentus SpinPoint M8 seem to have FPMDA_AA issues */ { "ST1000LM024 HN-M101MBB", "2AR10001", ATA_HORKAGE_BROKEN_FPDMA_AA }, + { "ST1000LM024 HN-M101MBB", "2BA30001", ATA_HORKAGE_BROKEN_FPDMA_AA },/* Blacklist entries taken from Silicon Image 3124/3132 Windows driver .inf file - also several Linux problem reports */
@@ -4143,6 +4154,23 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { { "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER }, { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, +/* +* Some WD SATA-I drives spin up and down erratically when the link +* is put into the slumber mode. We don't have full list of the +* affected devices. Disable LPM if the device matches one of the +* known prefixes and is SATA-1. As a side effect LPM partial is +* lost too. +* +* https://bugzilla.kernel.org/show_bug.cgi?id=57211 +*/ + { "WDC WD800JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + { "WDC WD1200JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + { "WDC WD1600JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + { "WDC WD2000JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + { "WDC WD2500JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + { "WDC WD3000JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + { "WDC WD3200JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + /* End Marker */ { } };
drivers/ata/libata-pmp.c +5 -2
@@ -447,8 +447,11 @@ static void sata_pmp_quirks(struct ata_port *ap)* otherwise. Don't try hard to recover it. */ ap->pmp_link[ap->nr_pmp_links -1 ].flags |=ATA_LFLAG_NO_RETRY ; - }else if (vendor ==0x197b && devid ==0x2352 ) { -/* chip found in Thermaltake BlackX Duet, jmicron JMB350? */ + }else if (vendor ==0x197b && (devid ==0x2352 || devid ==0x0325 )) { +/* +* 0x2352: found in Thermaltake BlackX Duet, jmicron JMB350? +* 0x0325: jmicron JMB394. +*/ ata_for_each_link (link, ap,EDGE ) {/* SRST breaks detection and disks get misclassified * LPM disabled to avoid potential problems
drivers/ata/libata-scsi.c +15 -3
@@ -111,12 +111,14 @@ static const char *ata_lpm_policy_names[] = { [ATA_LPM_MIN_POWER] = "min_power", }; -static ssize_t ata_scsi_lpm_store (struct device *dev, +static ssize_t ata_scsi_lpm_store (struct device *device,struct device_attribute *attr,const char *buf,size_t count) { -struct Scsi_Host *shost =class_to_shost (dev); +struct Scsi_Host *shost =class_to_shost (device);struct ata_port *ap =ata_shost_to_port (shost); +struct ata_link *link; +struct ata_device *dev;enum ata_lpm_policy policy;unsigned long flags;
@@ -132,10 +134,20 @@ static ssize_t ata_scsi_lpm_store(struct device *dev,return -EINVAL ;spin_lock_irqsave (ap->lock, flags); + +ata_for_each_link (link, ap,EDGE ) { +ata_for_each_dev (dev, &ap->link,ENABLED ) { +if (dev->horkage &ATA_HORKAGE_NOLPM ) { + count = -EOPNOTSUPP ; + goto out_unlock; + } + } + } + ap->target_lpm_policy = policy;ata_port_schedule_eh (ap); +out_unlock:spin_unlock_irqrestore (ap->lock, flags); -return count; }
drivers/ata/sata_sil.c +1 -0
@@ -157,6 +157,7 @@ static const struct sil_drivelist { { "ST380011ASL", SIL_QUIRK_MOD15WRITE }, { "ST3120022ASL", SIL_QUIRK_MOD15WRITE }, { "ST3160021ASL", SIL_QUIRK_MOD15WRITE }, + { "TOSHIBA MK2561GSYN", SIL_QUIRK_MOD15WRITE }, { "Maxtor 4D060H3", SIL_QUIRK_UDMA5MAX }, { } };
drivers/block/xen-blkfront.c +4 -1
@@ -1281,13 +1281,16 @@ static void blkback_changed(struct xenbus_device *dev,case XenbusStateReconfiguring:case XenbusStateReconfigured:case XenbusStateUnknown: -case XenbusStateClosed:break ;case XenbusStateConnected:blkfront_connect (info);break ; +case XenbusStateClosed: +if (dev->state == XenbusStateClosed) +break ; +/* Missed the backend's Closing state -- fallthrough */ case XenbusStateClosing:blkfront_closing (info);break ;
drivers/char/raw.c +1 -1
@@ -190,7 +190,7 @@ static int bind_get(int number, dev_t *dev)struct raw_device_data *rawdev;struct block_device *bdev; -if (number <=0 || number >=MAX_RAW_MINORS ) +if (number <=0 || number >= max_raw_minors)return -EINVAL ; rawdev = &raw_devices[number];
drivers/dma/ioat/dma.c +39 -7
90 lines not on this page · raw message
drivers/dma/ioat/dma.h +1 -0
@@ -344,6 +344,7 @@ bool ioat_cleanup_preamble(struct ioat_chan_common *chan, dma_addr_t *phys_complete);void ioat_kobject_add (struct ioatdma_device *device,struct kobj_type *type);void ioat_kobject_del (struct ioatdma_device *device); +void ioat_stop (struct ioat_chan_common *chan);extern const struct sysfs_ops ioat_sysfs_ops;extern struct ioat_sysfs_entry ioat_version_attr;extern struct ioat_sysfs_entry ioat_cap_attr;
drivers/dma/ioat/dma_v2.c +5 -6
@@ -189,8 +189,11 @@ static void ioat2_cleanup(struct ioat2_dma_chan *ioat)void ioat2_cleanup_event (unsigned long data) {struct ioat2_dma_chan *ioat =to_ioat2_chan ((void *) data); +struct ioat_chan_common *chan = &ioat->base;ioat2_cleanup (ioat); +if (!test_bit (IOAT_RUN , &chan->state)) +return ;writew (IOAT_CHANCTRL_RUN , ioat->base.reg_base +IOAT_CHANCTRL_OFFSET ); }
@@ -542,10 +545,10 @@ int ioat2_alloc_chan_resources(struct dma_chan *c) ioat->issued =0 ; ioat->tail =0 ; ioat->alloc_order = order; +set_bit (IOAT_RUN , &chan->state);spin_unlock_bh (&ioat->prep_lock);spin_unlock_bh (&chan->cleanup_lock); -tasklet_enable (&chan->cleanup_task);ioat2_start_null_desc (ioat);/* check that we got off the ground */
@@ -555,7 +558,6 @@ int ioat2_alloc_chan_resources(struct dma_chan *c) }while (i++ <20 && !is_ioat_active (status) && !is_ioat_idle (status));if (is_ioat_active (status) ||is_ioat_idle (status)) { -set_bit (IOAT_RUN , &chan->state);return 1 << ioat->alloc_order; }else {u32 chanerr =readl (chan->reg_base +IOAT_CHANERR_OFFSET );
@@ -798,11 +800,8 @@ void ioat2_free_chan_resources(struct dma_chan *c)if (!ioat->ring)return ; -tasklet_disable (&chan->cleanup_task); -del_timer_sync (&chan->timer); - device->cleanup_fn ((unsigned long ) c); +ioat_stop (chan); device->reset_hw (chan); -clear_bit (IOAT_RUN , &chan->state);spin_lock_bh (&chan->cleanup_lock);spin_lock_bh (&ioat->prep_lock);
drivers/dma/ioat/dma_v3.c +3 -0
@@ -325,8 +325,11 @@ static void ioat3_cleanup(struct ioat2_dma_chan *ioat)static void ioat3_cleanup_event (unsigned long data) {struct ioat2_dma_chan *ioat =to_ioat2_chan ((void *) data); +struct ioat_chan_common *chan = &ioat->base;ioat3_cleanup (ioat); +if (!test_bit (IOAT_RUN , &chan->state)) +return ;writew (IOAT_CHANCTRL_RUN , ioat->base.reg_base +IOAT_CHANCTRL_OFFSET ); }
drivers/dma/ste_dma40.c +3 -1
@@ -1202,6 +1202,7 @@ static void dma_tasklet(unsigned long data)struct d40_chan *d40c = (struct d40_chan *) data;struct d40_desc *d40d;unsigned long flags; +bool callback_active;dma_async_tx_callback callback;void *callback_param;
@@ -1225,6 +1226,7 @@ static void dma_tasklet(unsigned long data) }/* Callback to client */ + callback_active = !!(d40d->txd.flags &DMA_PREP_INTERRUPT ); callback = d40d->txd.callback; callback_param = d40d->txd.callback_param;
@@ -1249,7 +1251,7 @@ static void dma_tasklet(unsigned long data)spin_unlock_irqrestore (&d40c->lock, flags); -if (callback && (d40d->txd.flags &DMA_PREP_INTERRUPT )) +if (callback_active && callback)callback (callback_param);return ;
drivers/edac/edac_mc.c +7 -4
@@ -323,7 +323,8 @@ static void edac_mc_workq_function(struct work_struct *work_req)* * called with the mem_ctls_mutex held */ -static void edac_mc_workq_setup (struct mem_ctl_info *mci,unsigned msec) +static void edac_mc_workq_setup (struct mem_ctl_info *mci,unsigned msec, +bool init) {debugf0 ("%s()\n" , __func__);
@@ -331,7 +332,9 @@ static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec)if (mci->op_state !=OP_RUNNING_POLL )return ; -INIT_DELAYED_WORK (&mci->work, edac_mc_workq_function); +if (init) +INIT_DELAYED_WORK (&mci->work, edac_mc_workq_function); +queue_delayed_work (edac_workqueue, &mci->work,msecs_to_jiffies (msec)); }
@@ -391,7 +394,7 @@ void edac_mc_reset_delay_period(int value)list_for_each (item, &mc_devices) { mci = list_entry(item, struct mem_ctl_info, link); -edac_mc_workq_setup (mci, (unsigned long ) value); +edac_mc_workq_setup (mci, value, false); }mutex_unlock (&mem_ctls_mutex);
@@ -539,7 +542,7 @@ int edac_mc_add_mc(struct mem_ctl_info *mci)/* This instance is NOW RUNNING */ mci->op_state =OP_RUNNING_POLL ; -edac_mc_workq_setup (mci,edac_mc_get_poll_msec ()); +edac_mc_workq_setup (mci,edac_mc_get_poll_msec (), true); }else { mci->op_state =OP_RUNNING_INTERRUPT ; }
drivers/edac/i7300_edac.c +20 -18
@@ -962,33 +962,35 @@ static int __devinit i7300_get_devices(struct mem_ctl_info *mci)/* Attempt to 'get' the MCH register we want */ pdev =NULL ; -while (!pvt->pci_dev_16_1_fsb_addr_map || - !pvt->pci_dev_16_2_fsb_err_regs) { - pdev =pci_get_device (PCI_VENDOR_ID_INTEL , -PCI_DEVICE_ID_INTEL_I7300_MCH_ERR , pdev); -if (!pdev) { -/* End of list, leave */ -i7300_printk (KERN_ERR , -"'system address,Process Bus' " -"device not found:" -"vendor 0x%x device 0x%x ERR funcs " -"(broken BIOS?)\n" , -PCI_VENDOR_ID_INTEL , -PCI_DEVICE_ID_INTEL_I7300_MCH_ERR ); - goto error; - } - +while ((pdev =pci_get_device (PCI_VENDOR_ID_INTEL , +PCI_DEVICE_ID_INTEL_I7300_MCH_ERR , + pdev))) {/* Store device 16 funcs 1 and 2 */ switch (PCI_FUNC (pdev->devfn)) {case 1 : - pvt->pci_dev_16_1_fsb_addr_map = pdev; +if (!pvt->pci_dev_16_1_fsb_addr_map) + pvt->pci_dev_16_1_fsb_addr_map = +pci_dev_get (pdev);break ;case 2 : - pvt->pci_dev_16_2_fsb_err_regs = pdev; +if (!pvt->pci_dev_16_2_fsb_err_regs) + pvt->pci_dev_16_2_fsb_err_regs = +pci_dev_get (pdev);break ; } } +if (!pvt->pci_dev_16_1_fsb_addr_map || + !pvt->pci_dev_16_2_fsb_err_regs) { +/* At least one device was not found */ +i7300_printk (KERN_ERR , +"'system address,Process Bus' device not found:" +"vendor 0x%x device 0x%x ERR funcs (broken BIOS?)\n" , +PCI_VENDOR_ID_INTEL , +PCI_DEVICE_ID_INTEL_I7300_MCH_ERR ); + goto error; + } + debugf1("System Address, processor bus- PCI Bus ID: %s %x:%x\n", pci_name(pvt->pci_dev_16_0_fsb_ctlr), pvt->pci_dev_16_0_fsb_ctlr->vendor,
drivers/edac/i7core_edac.c +7 -2
@@ -1365,14 +1365,19 @@ static int i7core_get_onedevice(struct pci_dev **prev,* is at addr 8086:2c40, instead of 8086:2c41. So, we need * to probe for the alternate address in case of failure */ -if (dev_descr->dev_id ==PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev) +if (dev_descr->dev_id ==PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev) { +pci_dev_get (*prev);/* pci_get_device will put it */ pdev =pci_get_device (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_I7_NONCORE_ALT , *prev); + } -if (dev_descr->dev_id ==PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE && !pdev) +if (dev_descr->dev_id ==PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE && + !pdev) { +pci_dev_get (*prev);/* pci_get_device will put it */ pdev =pci_get_device (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_ALT , *prev); + }if (!pdev) {if (*prev) {
drivers/gpu/drm/i915/intel_display.c +14 -0
@@ -7252,6 +7252,20 @@ static int intel_gen7_queue_flip(struct drm_device *dev, goto err_unpin; } +/* +* BSpec MI_DISPLAY_FLIP for IVB: +* "The full packet must be contained within the same cache line." +* +* Currently the LRI+SRM+MI_DISPLAY_FLIP all fit within the same +* cacheline, if we ever start emitting more commands before +* the MI_DISPLAY_FLIP we may need to first emit everything else, +* then do the cacheline alignment, and finally emit the +* MI_DISPLAY_FLIP. +*/ + ret =intel_ring_cacheline_align (ring); +if (ret) + goto err_unpin; + ret =intel_ring_begin (ring,4 );if (ret) goto err_unpin;
drivers/gpu/drm/i915/intel_dp.c +13 -6
@@ -483,6 +483,7 @@ intel_dp_aux_native_write(struct intel_dp *intel_dp,uint8_t msg[20 ];int msg_bytes;uint8_t ack; +int retry;intel_dp_check_edp (intel_dp);if (send_bytes >16 )
@@ -493,18 +494,20 @@ intel_dp_aux_native_write(struct intel_dp *intel_dp, msg[3 ] = send_bytes -1 ;memcpy (&msg[4 ], send, send_bytes); msg_bytes = send_bytes +4 ; -for (;;) { +for (retry =0 ; retry <7 ; retry++) { ret =intel_dp_aux_ch (intel_dp, msg, msg_bytes, &ack,1 );if (ret <0 )return ret;if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_ACK ) -break ; +return send_bytes;else if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_DEFER ) -udelay (100 ); +usleep_range (400 ,500 );else return -EIO ; } -return send_bytes; + +DRM_ERROR ("too many retries, giving up\n" ); +return -EIO ; }/* Write a single byte to the aux channel in native mode */
@@ -526,6 +529,7 @@ intel_dp_aux_native_read(struct intel_dp *intel_dp,int reply_bytes;uint8_t ack;int ret; +int retry;intel_dp_check_edp (intel_dp); msg[0 ] =AUX_NATIVE_READ <<4 ;
@@ -536,7 +540,7 @@ intel_dp_aux_native_read(struct intel_dp *intel_dp, msg_bytes =4 ; reply_bytes = recv_bytes +1 ; -for (;;) { +for (retry =0 ; retry <7 ; retry++) { ret =intel_dp_aux_ch (intel_dp, msg, msg_bytes, reply, reply_bytes);if (ret ==0 )
@@ -549,10 +553,13 @@ intel_dp_aux_native_read(struct intel_dp *intel_dp,return ret -1 ; }else if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_DEFER ) -udelay (100 ); +usleep_range (400 ,500 );else return -EIO ; } + +DRM_ERROR ("too many retries, giving up\n" ); +return -EIO ; } static int
drivers/gpu/drm/i915/intel_ringbuffer.c +21 -0
@@ -1213,6 +1213,27 @@ int intel_ring_begin(struct intel_ring_buffer *ring,return 0 ; } +/* Align the ring tail to a cacheline boundary */ +int intel_ring_cacheline_align (struct intel_ring_buffer *ring) +{ +int num_dwords = (64 - (ring->tail &63 )) /sizeof (uint32_t ); +int ret; + +if (num_dwords ==0 ) +return 0 ; + + ret =intel_ring_begin (ring, num_dwords); +if (ret) +return ret; + +while (num_dwords--) +intel_ring_emit (ring,MI_NOOP ); + +intel_ring_advance (ring); + +return 0 ; +} +void intel_ring_advance (struct intel_ring_buffer *ring) { ring->tail &= ring->size -1 ;
drivers/gpu/drm/i915/intel_ringbuffer.h +1 -0
@@ -174,6 +174,7 @@ static inline int intel_wait_ring_idle(struct intel_ring_buffer *ring) }int __must_check intel_ring_begin (struct intel_ring_buffer *ring,int n); +int __must_check intel_ring_cacheline_align (struct intel_ring_buffer *ring);static inline void intel_ring_emit (struct intel_ring_buffer *ring,u32 data)
drivers/gpu/drm/radeon/atombios_crtc.c +4 -1
@@ -956,10 +956,13 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode ss_enabled =radeon_atombios_get_ppll_ss_info (rdev, &ss,ATOM_DP_SS_ID1 ); - }else + }else { ss_enabled =radeon_atombios_get_ppll_ss_info (rdev, &ss,ATOM_DP_SS_ID1 ); + } +/* disable spread spectrum on DCE3 DP */ + ss_enabled = false; }break ;case ATOM_ENCODER_MODE_LVDS :
drivers/gpu/drm/radeon/r600.c +8 -6
@@ -2315,14 +2315,18 @@ int r600_ring_test(struct radeon_device *rdev)void r600_fence_ring_emit (struct radeon_device *rdev,struct radeon_fence *fence) { +u32 cp_coher_cntl =PACKET3_TC_ACTION_ENA |PACKET3_VC_ACTION_ENA | +PACKET3_SH_ACTION_ENA ; + +if (rdev->family >=CHIP_RV770 ) + cp_coher_cntl |=PACKET3_FULL_CACHE_ENA ; +if (rdev->wb.use_event) {u64 addr = rdev->wb.gpu_addr +R600_WB_EVENT_OFFSET + (u64)(rdev->fence_drv.scratch_reg - rdev->scratch.reg_base);/* flush read cache over gart */ radeon_ring_write (rdev,PACKET3 (PACKET3_SURFACE_SYNC ,3 )); -radeon_ring_write (rdev,PACKET3_TC_ACTION_ENA | -PACKET3_VC_ACTION_ENA | -PACKET3_SH_ACTION_ENA ); +radeon_ring_write (rdev, cp_coher_cntl);radeon_ring_write (rdev,0xFFFFFFFF );radeon_ring_write (rdev,0 );radeon_ring_write (rdev,10 );/* poll interval */
@@ -2336,9 +2340,7 @@ void r600_fence_ring_emit(struct radeon_device *rdev, }else {/* flush read cache over gart */ radeon_ring_write (rdev,PACKET3 (PACKET3_SURFACE_SYNC ,3 )); -radeon_ring_write (rdev,PACKET3_TC_ACTION_ENA | -PACKET3_VC_ACTION_ENA | -PACKET3_SH_ACTION_ENA ); +radeon_ring_write (rdev, cp_coher_cntl);radeon_ring_write (rdev,0xFFFFFFFF );radeon_ring_write (rdev,0 );radeon_ring_write (rdev,10 );/* poll interval */
drivers/gpu/drm/radeon/r600d.h +1 -0
@@ -838,6 +838,7 @@#define PACKET3_INDIRECT_BUFFER 0x32#define PACKET3_SURFACE_SYNC 0x43# define PACKET3_CB0_DEST_BASE_ENA (1 << 6) +# define PACKET3_FULL_CACHE_ENA (1 << 20)/* r7xx+ only */ # define PACKET3_TC_ACTION_ENA (1 << 23)# define PACKET3_VC_ACTION_ENA (1 << 24)# define PACKET3_CB_ACTION_ENA (1 << 25)
drivers/gpu/drm/radeon/radeon_atombios.c +4 -0
@@ -2735,6 +2735,10 @@ void radeon_atom_initialize_bios_scratch_regs(struct drm_device *dev)/* tell the bios not to handle mode switching */ bios_6_scratch |=ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH ; +/* clear the vbios dpms state */ +if (ASIC_IS_DCE4 (rdev)) + bios_2_scratch &= ~ATOM_S2_DEVICE_DPMS_STATE ; +if (rdev->family >=CHIP_R600 ) {WREG32 (R600_BIOS_2_SCRATCH , bios_2_scratch);WREG32 (R600_BIOS_6_SCRATCH , bios_6_scratch);
drivers/gpu/drm/radeon/radeon_i2c.c +3 -0
@@ -998,6 +998,9 @@ void radeon_i2c_destroy(struct radeon_i2c_chan *i2c)/* Add the default buses */ void radeon_i2c_init (struct radeon_device *rdev) { +if (radeon_hw_i2c) +DRM_INFO ("hw_i2c forced on, you may experience display detection problems!\n" ); +if (rdev->is_atom_bios)radeon_atombios_i2c_init (rdev);else
drivers/gpu/drm/radeon/radeon_pm.c +4 -2
@@ -573,8 +573,10 @@ void radeon_pm_resume(struct radeon_device *rdev) rdev->pm.current_clock_mode_index =0 ; rdev->pm.current_sclk = rdev->pm.default_sclk; rdev->pm.current_mclk = rdev->pm.default_mclk; - rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0 ].voltage.voltage; - rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0 ].voltage.vddci; +if (rdev->pm.power_state) { + rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0 ].voltage.voltage; + rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0 ].voltage.vddci; + }if (rdev->pm.pm_method ==PM_METHOD_DYNPM && rdev->pm.dynpm_state ==DYNPM_STATE_SUSPENDED ) { rdev->pm.dynpm_state =DYNPM_STATE_ACTIVE ;
drivers/hv/connection.c +1 -11
@@ -45,7 +45,6 @@ struct vmbus_connection vmbus_connection = {int vmbus_connect (void ) {int ret =0 ; -int t;struct vmbus_channel_msginfo *msginfo =NULL ;struct vmbus_channel_initiate_contact *msg;unsigned long flags;
@@ -132,16 +131,7 @@ int vmbus_connect(void) }/* Wait for the connection response */ - t =wait_for_completion_timeout (&msginfo->waitevent,5 *HZ ); -if (t ==0 ) { -spin_lock_irqsave (&vmbus_connection.channelmsg_lock, - flags); -list_del (&msginfo->msglistentry); -spin_unlock_irqrestore (&vmbus_connection.channelmsg_lock, - flags); - ret = -ETIMEDOUT ; - goto cleanup; - } +wait_for_completion (&msginfo->waitevent);spin_lock_irqsave (&vmbus_connection.channelmsg_lock, flags);list_del (&msginfo->msglistentry);
drivers/hwmon/max1668.c +1 -1
@@ -243,7 +243,7 @@ static ssize_t set_temp_min(struct device *dev, data->temp_min[index] =SENSORS_LIMIT (temp/1000 ,-128 ,127 );if (i2c_smbus_write_byte_data (client,MAX1668_REG_LIML_WR (index), - data->temp_max[index])) + data->temp_min[index])) count = -EIO ;mutex_unlock (&data->update_lock);
drivers/i2c/busses/Kconfig +1 -0
@@ -137,6 +137,7 @@ config I2C_PIIX4 ATI SB700 ATI SB800 AMD Hudson-2 + AMD ML AMD CZ Serverworks OSB4 Serverworks CSB5
drivers/i2c/busses/i2c-piix4.c +22 -4
@@ -22,7 +22,7 @@ Intel PIIX4, 440MX Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100 ATI IXP200, IXP300, IXP400, SB600, SB700, SB800 - AMD Hudson-2, CZ + AMD Hudson-2, ML, CZ SMSC Victory66 Note: we assume there can only be one device, with one SMBus interface.
@@ -231,7 +231,8 @@ static int __devinit piix4_setup_sb800(struct pci_dev *PIIX4_dev, const struct pci_device_id *id) {unsigned short smba_idx =0xcd6 ; -u8 smba_en_lo, smba_en_hi, i2ccfg, i2ccfg_offset =0x10 , smb_en =0x2c ; +u8 smba_en_lo, smba_en_hi, smb_en, smb_en_status; +u8 i2ccfg, i2ccfg_offset =0x10 ;/* SB800 and later SMBus does not support forcing address */ if (force || force_addr) {
@@ -241,6 +242,16 @@ static int __devinit piix4_setup_sb800(struct pci_dev *PIIX4_dev, }/* Determine the address of the SMBus areas */ +if ((PIIX4_dev->vendor ==PCI_VENDOR_ID_AMD && + PIIX4_dev->device ==PCI_DEVICE_ID_AMD_HUDSON2_SMBUS && + PIIX4_dev->revision >=0x41 ) || + (PIIX4_dev->vendor ==PCI_VENDOR_ID_AMD && + PIIX4_dev->device ==0x790b && + PIIX4_dev->revision >=0x49 )) + smb_en =0x00 ; +else + smb_en =0x2c ; +if (!request_region (smba_idx,2 ,"smba_idx" )) {dev_err (&PIIX4_dev->dev,"SMBus base address index region " "0x%x already in use!\n" , smba_idx);
@@ -252,13 +263,20 @@ static int __devinit piix4_setup_sb800(struct pci_dev *PIIX4_dev, smba_en_hi =inb_p (smba_idx +1 );release_region (smba_idx,2 ); -if ((smba_en_lo &1 ) ==0 ) { +if (!smb_en) { + smb_en_status = smba_en_lo &0x10 ; + piix4_smba = smba_en_hi <<8 ; + }else { + smb_en_status = smba_en_lo &0x01 ; + piix4_smba = ((smba_en_hi <<8 ) | smba_en_lo) &0xffe0 ; + } + +if (!smb_en_status) {dev_err (&PIIX4_dev->dev,"Host SMBus controller not enabled!\n" );return -ENODEV ; } - piix4_smba = ((smba_en_hi <<8 ) | smba_en_lo) &0xffe0 ;if (acpi_check_region (piix4_smba,SMBIOSIZE , piix4_driver.name))return -ENODEV ;
drivers/idle/intel_idle.c +2 -1
@@ -584,8 +584,9 @@ static int __init intel_idle_init(void)intel_idle_cpuidle_driver_init (); retval =cpuidle_register_driver (&intel_idle_driver);if (retval) { +struct cpuidle_driver *drv =cpuidle_get_driver (); printk(KERN_DEBUG PREFIX "intel_idle yielding to %s", - cpuidle_get_driver()->name); + drv ? drv->name : "none");return retval; }
drivers/infiniband/hw/qib/qib_iba7322.c +5 -0
@@ -2279,6 +2279,11 @@ static int qib_7322_bringup_serdes(struct qib_pportdata *ppd)qib_write_kreg_port (ppd, krp_ibcctrl_a, ppd->cpspec->ibcctrl_a);qib_write_kreg (dd, kr_scratch,0ULL ); +/* ensure previous Tx parameters are not still forced */ +qib_write_kreg_port (ppd, krp_tx_deemph_override, +SYM_MASK (IBSD_TX_DEEMPHASIS_OVERRIDE_0 , + reset_tx_deemphasis_override)); +if (qib_compat_ddr_negotiate) { ppd->cpspec->ibdeltainprog =1 ; ppd->cpspec->ibsymsnap = read_7322_creg32_port(ppd,
drivers/infiniband/hw/qib/qib_ud.c +8 -1
@@ -57,13 +57,20 @@ static void qib_ud_loopback(struct qib_qp *sqp, struct qib_swqe *swqe)struct qib_sge *sge;struct ib_wc wc;u32 length; +enum ib_qp_type sqptype, dqptype; qp =qib_lookup_qpn (ibp, swqe->wr.wr.ud.remote_qpn);if (!qp) { ibp->n_pkt_drops++;return ; } -if (qp->ibqp.qp_type != sqp->ibqp.qp_type || + + sqptype = sqp->ibqp.qp_type ==IB_QPT_GSI ? +IB_QPT_UD : sqp->ibqp.qp_type; + dqptype = qp->ibqp.qp_type ==IB_QPT_GSI ? +IB_QPT_UD : qp->ibqp.qp_type; + +if (dqptype != sqptype || !(ib_qib_state_ops[qp->state] &QIB_PROCESS_RECV_OK )) { ibp->n_pkt_drops++; goto drop;
drivers/iommu/intel-iommu.c +1 -1
@@ -884,7 +884,7 @@ static void dma_pte_free_level(struct dmar_domain *domain, int level,/* If range covers entire pagetable, free it */ if (!(start_pfn > level_pfn || - last_pfn < level_pfn +level_size (level))) { + last_pfn < level_pfn +level_size (level) -1 )) {dma_clear_pte (pte);domain_flush_cache (domain, pte,sizeof (*pte));free_pgtable_page (level_pte);
drivers/md/Kconfig +4 -0
@@ -185,8 +185,12 @@ config MD_FAULTY In unsure, say N. +config BLK_DEV_DM_BUILTIN + boolean + config BLK_DEV_DM tristate "Device mapper support" + select BLK_DEV_DM_BUILTIN ---help--- Device-mapper is a low level volume manager. It works by allowing people to specify mappings for ranges of logical sectors. Various
drivers/md/Makefile +1 -0
@@ -28,6 +28,7 @@ obj-$(CONFIG_MD_MULTIPATH) += multipath.o obj-$(CONFIG_MD_FAULTY) += faulty.o obj-$(CONFIG_BLK_DEV_MD) += md-mod.o obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o +obj-$(CONFIG_BLK_DEV_DM_BUILTIN) += dm-builtin.o obj-$(CONFIG_DM_BUFIO) += dm-bufio.o obj-$(CONFIG_DM_CRYPT) += dm-crypt.o obj-$(CONFIG_DM_DELAY) += dm-delay.o
drivers/md/dm-builtin.c new file +49 -0
49 lines not on this page · raw message
drivers/md/dm-sysfs.c +4 -1
@@ -86,6 +86,7 @@ static const struct sysfs_ops dm_sysfs_ops = {static struct kobj_type dm_ktype = { .sysfs_ops = &dm_sysfs_ops, .default_attrs = dm_attrs, + .release = dm_kobject_release, };/*
@@ -104,5 +105,7 @@ int dm_sysfs_init(struct mapped_device *md)*/ void dm_sysfs_exit (struct mapped_device *md) { -kobject_put (dm_kobject (md)); +struct kobject *kobj =dm_kobject (md); +kobject_put (kobj); +wait_for_completion (dm_get_completion_from_kobject (kobj)); }
drivers/md/dm.c +5 -6
@@ -192,8 +192,8 @@ struct mapped_device {/* forced geometry settings */ struct hd_geometry geometry; -/* sysfs handle */ -struct kobject kobj; +/* kobject and completion */ +struct dm_kobject_holder kobj_holder;/* zero-length flush that will be cloned and submitted to targets */ struct bio flush_bio;
@@ -1891,6 +1891,7 @@ static struct mapped_device *alloc_dev(int minor)init_waitqueue_head (&md->wait);INIT_WORK (&md->work, dm_wq_work);init_waitqueue_head (&md->eventq); +init_completion (&md->kobj_holder.completion); md->disk->major = _major; md->disk->first_minor = minor;
@@ -2682,7 +2683,7 @@ struct gendisk *dm_disk(struct mapped_device *md)struct kobject *dm_kobject (struct mapped_device *md) { -return &md->kobj; +return &md->kobj_holder.kobj; }/*
@@ -2693,9 +2694,7 @@ struct mapped_device *dm_get_from_kobject(struct kobject *kobj) {struct mapped_device *md; - md = container_of(kobj, struct mapped_device, kobj); -if (&md->kobj != kobj) -return NULL ; + md = container_of(kobj, struct mapped_device, kobj_holder.kobj);if (test_bit (DMF_FREEING , &md->flags) ||dm_deleting_md (md))
drivers/md/dm.h +17 -0
@@ -15,6 +15,8 @@#include <linux/list.h> #include <linux/blkdev.h> #include <linux/hdreg.h> +#include <linux/completion.h> +#include <linux/kobject.h> /* * Suspend feature flags
@@ -119,12 +121,27 @@ void dm_interface_exit(void);/* * sysfs interface */ +struct dm_kobject_holder { +struct kobject kobj; +struct completion completion; +}; + +static inline struct completion *dm_get_completion_from_kobject (struct kobject *kobj) +{ + return &container_of(kobj, struct dm_kobject_holder, kobj)->completion; +} +int dm_sysfs_init (struct mapped_device *md);void dm_sysfs_exit (struct mapped_device *md);struct kobject *dm_kobject (struct mapped_device *md);struct mapped_device *dm_get_from_kobject (struct kobject *kobj);/* +* The kobject helper +*/ +void dm_kobject_release (struct kobject *kobj); + +/* * Targets for linear and striped mappings */ int dm_linear_init (void );
drivers/md/persistent-data/dm-space-map-common.c +5 -1
@@ -244,6 +244,10 @@ int sm_ll_extend(struct ll_disk *ll, dm_block_t extra_blocks)return -EINVAL ; } +/* +* We need to set this before the dm_tm_new_block() call below. +*/ + ll->nr_blocks = nr_blocks;for (i = old_blocks; i < blocks; i++) {struct dm_block *b;struct disk_index_entry idx;
@@ -251,6 +255,7 @@ int sm_ll_extend(struct ll_disk *ll, dm_block_t extra_blocks) r =dm_tm_new_block (ll->tm, &dm_sm_bitmap_validator, &b);if (r <0 )return r; + idx.blocknr =cpu_to_le64 (dm_block_location (b)); r =dm_tm_unlock (ll->tm, b);
@@ -265,7 +270,6 @@ int sm_ll_extend(struct ll_disk *ll, dm_block_t extra_blocks)return r; } - ll->nr_blocks = nr_blocks;return 0 ; }
drivers/md/raid5.c +45 -46
139 lines not on this page · raw message
drivers/media/dvb/dvb-usb/mxl111sf-tuner.h +1 -1
@@ -69,7 +69,7 @@ struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe,#else static inline struct dvb_frontend *mxl111sf_tuner_attach (struct dvb_frontend *fe, - struct mxl111sf_state *mxl_state +struct mxl111sf_state *mxl_state,struct mxl111sf_tuner_config *cfg) {printk (KERN_WARNING "%s: driver disabled by Kconfig\n" , __func__);
drivers/media/dvb/frontends/dib8000.c +25 -8
@@ -114,15 +114,10 @@ static u16 dib8000_i2c_read16(struct i2c_device *i2c, u16 reg)return ret; } -static u16 dib8000_read_word (struct dib8000_state *state,u16 reg) +static u16 __dib8000_read_word (struct dib8000_state *state,u16 reg) {u16 ret; -if (mutex_lock_interruptible (&state->i2c_buffer_lock) <0 ) { -dprintk ("could not acquire lock" ); -return 0 ; - } - state->i2c_write_buffer[0 ] = reg >>8 ; state->i2c_write_buffer[1 ] = reg &0xff ;
@@ -140,6 +135,21 @@ static u16 dib8000_read_word(struct dib8000_state *state, u16 reg)dprintk ("i2c read error on %d" , reg); ret = (state->i2c_read_buffer[0 ] <<8 ) | state->i2c_read_buffer[1 ]; + +return ret; +} + +static u16 dib8000_read_word (struct dib8000_state *state,u16 reg) +{ +u16 ret; + +if (mutex_lock_interruptible (&state->i2c_buffer_lock) <0 ) { +dprintk ("could not acquire lock" ); +return 0 ; + } + + ret =__dib8000_read_word (state, reg); +mutex_unlock (&state->i2c_buffer_lock);return ret;
@@ -149,8 +159,15 @@ static u32 dib8000_read32(struct dib8000_state *state, u16 reg) {u16 rw[2 ]; - rw[0 ] =dib8000_read_word (state, reg +0 ); - rw[1 ] =dib8000_read_word (state, reg +1 ); +if (mutex_lock_interruptible (&state->i2c_buffer_lock) <0 ) { +dprintk ("could not acquire lock" ); +return 0 ; + } + + rw[0 ] =__dib8000_read_word (state, reg +0 ); + rw[1 ] =__dib8000_read_word (state, reg +1 ); + +mutex_unlock (&state->i2c_buffer_lock);return ((rw[0 ] <<16 ) | (rw[1 ])); }
drivers/media/video/saa7134/saa7134-alsa.c +2 -0
@@ -172,7 +172,9 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev,dprintk ("irq: overrun [full=%d/%d] - Blocks in %d\n" ,dev->dmasound.read_count, dev->dmasound.bufsize, dev->dmasound.blocks);spin_unlock (&dev->slock); +snd_pcm_stream_lock (dev->dmasound.substream);snd_pcm_stop (dev->dmasound.substream,SNDRV_PCM_STATE_XRUN ); +snd_pcm_stream_unlock (dev->dmasound.substream);return ; }
drivers/mmc/host/atmel-mci.c +12 -1
@@ -1014,11 +1014,22 @@ static void atmci_start_request(struct atmel_mci *host, iflags |=ATMCI_CMDRDY ; cmd = mrq->cmd; cmdflags =atmci_prepare_command (slot->mmc, cmd); -atmci_send_command (host, cmd, cmdflags); + +/* +* DMA transfer should be started before sending the command to avoid +* unexpected errors especially for read operations in SDIO mode. +* Unfortunately, in PDC mode, command has to be sent before starting +* the transfer. +*/ +if (host->submit_data != &atmci_submit_data_dma) +atmci_send_command (host, cmd, cmdflags);if (data) host->submit_data (host, data); +if (host->submit_data == &atmci_submit_data_dma) +atmci_send_command (host, cmd, cmdflags); +if (mrq->stop) { host->stop_cmdr =atmci_prepare_command (slot->mmc, mrq->stop); host->stop_cmdr |=ATMCI_CMDR_STOP_XFER ;
drivers/mmc/host/sdhci.c +6 -11
@@ -1670,12 +1670,12 @@ static int sdhci_execute_tuning(struct mmc_host *mmc)int tuning_loop_counter =MAX_TUNING_LOOP ;unsigned long timeout;int err =0 ; +unsigned long flags; host =mmc_priv (mmc);sdhci_runtime_pm_get (host); -disable_irq (host->irq); -spin_lock (&host->lock); +spin_lock_irqsave (&host->lock, flags); ctrl =sdhci_readw (host,SDHCI_HOST_CONTROL2 );
@@ -1689,8 +1689,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc) (host->flags & SDHCI_SDR50_NEEDS_TUNING))) ctrl |= SDHCI_CTRL_EXEC_TUNING; else { -spin_unlock (&host->lock); -enable_irq (host->irq); +spin_unlock_irqrestore (&host->lock, flags);sdhci_runtime_pm_put (host);return 0 ; }
@@ -1752,15 +1751,12 @@ static int sdhci_execute_tuning(struct mmc_host *mmc) host->cmd =NULL ; host->mrq =NULL ; -spin_unlock (&host->lock); -enable_irq (host->irq); - +spin_unlock_irqrestore (&host->lock, flags);/* Wait for Buffer Read Ready interrupt */ wait_event_interruptible_timeout (host->buf_ready_int, (host->tuning_done ==1 ),msecs_to_jiffies (50 )); -disable_irq (host->irq); -spin_lock (&host->lock); +spin_lock_irqsave (&host->lock, flags);if (!host->tuning_done) { pr_info(DRIVER_NAME ": Timeout waiting for "
@@ -1833,8 +1829,7 @@ out: err =0 ;sdhci_clear_set_irqs (host,SDHCI_INT_DATA_AVAIL , ier); -spin_unlock (&host->lock); -enable_irq (host->irq); +spin_unlock_irqrestore (&host->lock, flags);sdhci_runtime_pm_put (host);return err;
drivers/mtd/nand/mxc_nand.c +0 -1
@@ -596,7 +596,6 @@ static int mxc_nand_correct_data_v2_v3(struct mtd_info *mtd, u_char *dat, ecc_stat >>=4 ; }while (--no_subpages); - mtd->ecc_stats.corrected += ret;pr_debug ("%d Symbol Correctable RS-ECC Error\n" , ret);return ret;
drivers/net/bonding/bond_3ad.c +2 -4
@@ -1854,8 +1854,6 @@ void bond_3ad_initiate_agg_selection(struct bonding *bond, int timeout)BOND_AD_INFO (bond).agg_select_timer = timeout; } -static u16 aggregator_identifier; -/** * bond_3ad_initialize - initialize a bond's 802.3ad parameters and structures * @bond: bonding struct to work on
@@ -1869,7 +1867,7 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)if (MAC_ADDRESS_COMPARE (&(BOND_AD_INFO (bond).system.sys_mac_addr), bond->dev->dev_addr)) { - aggregator_identifier =0 ; +BOND_AD_INFO (bond).aggregator_identifier =0 ;BOND_AD_INFO (bond).system.sys_priority =0xFFFF ;BOND_AD_INFO (bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
@@ -1941,7 +1939,7 @@ int bond_3ad_bind_slave(struct slave *slave)ad_initialize_agg (aggregator); aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr); - aggregator->aggregator_identifier = (++aggregator_identifier); + aggregator->aggregator_identifier = ++BOND_AD_INFO (bond).aggregator_identifier; aggregator->slave = slave; aggregator->is_active =0 ; aggregator->num_of_ports =0 ;
drivers/net/bonding/bond_3ad.h +1 -0
@@ -253,6 +253,7 @@ struct ad_system {struct ad_bond_info {struct ad_system system;/* 802.3ad system structure */ u32 agg_select_timer;// Timer to select aggregator after all adapter's hand shakes +u16 aggregator_identifier; };struct ad_slave_info {
drivers/net/can/flexcan.c +9 -4
@@ -777,14 +777,16 @@ static void flexcan_chip_stop(struct net_device *dev)struct flexcan_regs __iomem *regs = priv->base;u32 reg; -/* Disable all interrupts */ -flexcan_write (0 , ®s->imask1); -/* Disable + halt module */ reg =flexcan_read (®s->mcr); reg |=FLEXCAN_MCR_MDIS |FLEXCAN_MCR_HALT ;flexcan_write (reg, ®s->mcr); +/* Disable all interrupts */ +flexcan_write (0 , ®s->imask1); +flexcan_write (priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL , + ®s->ctrl); +flexcan_transceiver_switch (priv,0 ); priv->can.state =CAN_STATE_STOPPED ;
@@ -809,12 +811,14 @@ static int flexcan_open(struct net_device *dev)/* start chip and queuing */ err =flexcan_chip_start (dev);if (err) - goto out_close; + goto out_free_irq;napi_enable (&priv->napi);netif_start_queue (dev);return 0 ; + out_free_irq: +free_irq (dev->irq, dev); out_close:close_candev (dev); out:
@@ -1023,6 +1027,7 @@ static int __devexit flexcan_remove(struct platform_device *pdev)struct resource *mem;unregister_flexcandev (dev); +netif_napi_del (&priv->napi);platform_set_drvdata (pdev,NULL );iounmap (priv->base);
drivers/net/ethernet/broadcom/tg3.c +3 -4
@@ -5637,8 +5637,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) work_mask |= opaque_key; -if ((desc->err_vlan &RXD_ERR_MASK ) !=0 && - (desc->err_vlan !=RXD_ERR_ODD_NIBBLE_RCVD_MII )) { +if (desc->err_vlan &RXD_ERR_MASK ) { drop_it:tg3_recycle_rx (tnapi, tpr, opaque_key, desc_idx, *post_ptr);
@@ -7103,12 +7102,12 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu)tg3_netif_stop (tp); +tg3_set_mtu (dev, tp, new_mtu); +tg3_full_lock (tp,1 );tg3_halt (tp,RESET_KIND_SHUTDOWN ,1 ); -tg3_set_mtu (dev, tp, new_mtu); - err =tg3_restart_hw (tp,0 );if (!err)
drivers/net/ethernet/broadcom/tg3.h +5 -1
@@ -2477,7 +2477,11 @@ struct tg3_rx_buffer_desc {#define RXD_ERR_TOO_SMALL 0x00400000#define RXD_ERR_NO_RESOURCES 0x00800000#define RXD_ERR_HUGE_FRAME 0x01000000 -#define RXD_ERR_MASK 0xffff0000 + +#define RXD_ERR_MASK (RXD_ERR_BAD_CRC | RXD_ERR_COLLISION | \ + RXD_ERR_LINK_LOST | RXD_ERR_PHY_DECODE | \ + RXD_ERR_MAC_ABRT | RXD_ERR_TOO_SMALL | \ + RXD_ERR_NO_RESOURCES | RXD_ERR_HUGE_FRAME)u32 reserved;u32 opaque;
drivers/net/usb/gl620a.c +4 -0
@@ -86,6 +86,10 @@ static int genelink_rx_fixup(struct usbnet *dev, struct sk_buff *skb)u32 size;u32 count; +/* This check is no longer done by usbnet */ +if (skb->len < dev->net->hard_header_len) +return 0 ; + header = (struct gl_header *) skb->data;// get the packet count of the received skb
drivers/net/usb/mcs7830.c +3 -2
@@ -601,8 +601,9 @@ static int mcs7830_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {u8 status; -if (skb->len ==0 ) { -dev_err (&dev->udev->dev,"unexpected empty rx frame\n" ); +/* This check is no longer done by usbnet */ +if (skb->len < dev->net->hard_header_len) { +dev_err (&dev->udev->dev,"unexpected tiny rx frame\n" );return 0 ; }
drivers/net/usb/net1080.c +4 -0
@@ -419,6 +419,10 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb)struct nc_trailer *trailer;u16 hdr_len, packet_len; +/* This check is no longer done by usbnet */ +if (skb->len < dev->net->hard_header_len) +return 0 ; +if (!(skb->len &0x01 )) {#ifdef DEBUG struct net_device *net = dev->net;
drivers/net/usb/rndis_host.c +4 -0
@@ -490,6 +490,10 @@ EXPORT_SYMBOL_GPL(rndis_unbind);*/ int rndis_rx_fixup (struct usbnet *dev,struct sk_buff *skb) { +/* This check is no longer done by usbnet */ +if (skb->len < dev->net->hard_header_len) +return 0 ; +/* peripheral may have batched packets to us... */ while (likely (skb->len)) {struct rndis_data_hdr *hdr = (void *)skb->data;
drivers/net/usb/smsc75xx.c +4 -0
@@ -1079,6 +1079,10 @@ static void smsc75xx_rx_csum_offload(struct usbnet *dev, struct sk_buff *skb,static int smsc75xx_rx_fixup (struct usbnet *dev,struct sk_buff *skb) { +/* This check is no longer done by usbnet */ +if (skb->len < dev->net->hard_header_len) +return 0 ; +while (skb->len >0 ) {u32 rx_cmd_a, rx_cmd_b, align_count, size;struct sk_buff *ax_skb;
drivers/net/usb/smsc95xx.c +4 -0
@@ -1039,6 +1039,10 @@ static void smsc95xx_rx_csum_offload(struct sk_buff *skb)static int smsc95xx_rx_fixup (struct usbnet *dev,struct sk_buff *skb) { +/* This check is no longer done by usbnet */ +if (skb->len < dev->net->hard_header_len) +return 0 ; +while (skb->len >0 ) {u32 header, align_count;struct sk_buff *ax_skb;
drivers/net/usb/usbnet.c +10 -15
@@ -414,17 +414,19 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) }// else network stack removes extra byte if we forced a short packet -if (skb->len) { -/* all data was already cloned from skb inside the driver */ -if (dev->driver_info->flags &FLAG_MULTI_PACKET ) -dev_kfree_skb_any (skb); -else -usbnet_skb_return (dev, skb); +/* all data was already cloned from skb inside the driver */ +if (dev->driver_info->flags &FLAG_MULTI_PACKET ) + goto done; + +if (skb->len <ETH_HLEN ) { + dev->net->stats.rx_errors++; + dev->net->stats.rx_length_errors++; +netif_dbg (dev, rx_err, dev->net,"rx length %d\n" , skb->len); + }else { +usbnet_skb_return (dev, skb);return ; } -netif_dbg (dev, rx_err, dev->net,"drop\n" ); - dev->net->stats.rx_errors++; done:skb_queue_tail (&dev->done, skb); }
@@ -446,13 +448,6 @@ static void rx_complete (struct urb *urb)switch (urb_status) {/* success */ case 0 : -if (skb->len < dev->net->hard_header_len) { - state = rx_cleanup; - dev->net->stats.rx_errors++; - dev->net->stats.rx_length_errors++; -netif_dbg (dev, rx_err, dev->net, -"rx length %d\n" , skb->len); - }break ;/* stalls need manual reset. this is rare ... except that
drivers/net/virtio_net.c +2 -1
@@ -1029,7 +1029,8 @@ static int virtnet_probe(struct virtio_device *vdev)/* If we can receive ANY GSO packets, we must allocate large ones. */ if (virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_TSO4 ) ||virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_TSO6 ) || -virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_ECN )) +virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_ECN ) || +virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_UFO )) vi->big_packets = true;if (virtio_has_feature (vdev,VIRTIO_NET_F_MRG_RXBUF ))
drivers/net/vmxnet3/vmxnet3_drv.c +14 -5
@@ -1734,11 +1734,20 @@ vmxnet3_netpoll(struct net_device *netdev) {struct vmxnet3_adapter *adapter =netdev_priv (netdev); -if (adapter->intr.mask_mode ==VMXNET3_IMM_ACTIVE ) -vmxnet3_disable_all_intrs (adapter); - -vmxnet3_do_poll (adapter, adapter->rx_queue[0 ].rx_ring[0 ].size); -vmxnet3_enable_all_intrs (adapter); +switch (adapter->intr.type) { +#ifdef CONFIG_PCI_MSI +case VMXNET3_IT_MSIX : { +int i; +for (i =0 ; i < adapter->num_rx_queues; i++) +vmxnet3_msix_rx (0 , &adapter->rx_queue[i]); +break ; + } +#endif +case VMXNET3_IT_MSI : +default : +vmxnet3_intr (0 , adapter->netdev); +break ; + } }#endif /* CONFIG_NET_POLL_CONTROLLER */
drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h +2 -2
@@ -55,7 +55,7 @@ static const u32 ar9462_2p0_baseband_postamble[][5] = { {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3039605e, 0x33795d5e}, {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, - {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce}, + {0x00009e20, 0x000003a5, 0x000003a5, 0x000003a5, 0x000003a5}, {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021}, {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c782}, {0x00009e44, 0xfe321e27, 0xfe321e27, 0xfe291e27, 0xfe291e27},
@@ -85,7 +85,7 @@ static const u32 ar9462_2p0_baseband_postamble[][5] = { {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000}, {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, - {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce}, + {0x0000ae20, 0x000001a6, 0x000001a6, 0x000001aa, 0x000001aa}, {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550}, };
drivers/net/wireless/ath/ath9k/htc_drv_init.c +7 -1
@@ -28,6 +28,10 @@ int htc_modparam_nohwcrypt;module_param_named (nohwcrypt, htc_modparam_nohwcrypt, int,0444 );MODULE_PARM_DESC (nohwcrypt,"Disable hardware encryption" ); +static int ath9k_ps_enable; +module_param_named (ps_enable, ath9k_ps_enable, int,0444 ); +MODULE_PARM_DESC (ps_enable,"Enable WLAN PowerSave" ); +#define CHAN2G (_freq, _idx) { \ .center_freq = (_freq), \ .hw_value = (_idx), \
@@ -729,11 +733,13 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv,IEEE80211_HW_SPECTRUM_MGMT |IEEE80211_HW_HAS_RATE_CONTROL |IEEE80211_HW_RX_INCLUDES_FCS | -IEEE80211_HW_SUPPORTS_PS |IEEE80211_HW_PS_NULLFUNC_STACK |IEEE80211_HW_REPORTS_TX_ACK_STATUS |IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING ; +if (ath9k_ps_enable) + hw->flags |=IEEE80211_HW_SUPPORTS_PS ; + hw->wiphy->interface_modes =BIT (NL80211_IFTYPE_STATION ) | BIT(NL80211_IFTYPE_ADHOC) |
drivers/net/wireless/ath/ath9k/init.c +7 -1
@@ -44,6 +44,10 @@ static int ath9k_btcoex_enable;module_param_named (btcoex_enable, ath9k_btcoex_enable, int,0444 );MODULE_PARM_DESC (btcoex_enable,"Enable wifi-BT coexistence" ); +static int ath9k_ps_enable; +module_param_named (ps_enable, ath9k_ps_enable, int,0444 ); +MODULE_PARM_DESC (ps_enable,"Enable WLAN PowerSave" ); +bool is_ath9k_unloaded;/* We use the hw_value as an index into our private channel structure */
@@ -671,11 +675,13 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) hw->flags =IEEE80211_HW_RX_INCLUDES_FCS |IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |IEEE80211_HW_SIGNAL_DBM | -IEEE80211_HW_SUPPORTS_PS |IEEE80211_HW_PS_NULLFUNC_STACK |IEEE80211_HW_SPECTRUM_MGMT |IEEE80211_HW_REPORTS_TX_ACK_STATUS ; +if (ath9k_ps_enable) + hw->flags |=IEEE80211_HW_SUPPORTS_PS ; +if (sc->sc_ah->caps.hw_caps &ATH9K_HW_CAP_HT ) hw->flags |=IEEE80211_HW_AMPDU_AGGREGATION ;
drivers/net/wireless/ath/ath9k/xmit.c +5 -3
@@ -1176,14 +1176,16 @@ void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc,for (tidno =0 , tid = &an->tid[tidno]; tidno <WME_NUM_TID ; tidno++, tid++) { -if (!tid->sched) -continue ; - ac = tid->ac; txq = ac->txq;spin_lock_bh (&txq->axq_lock); +if (!tid->sched) { +spin_unlock_bh (&txq->axq_lock); +continue ; + } + buffered = !skb_queue_empty (&tid->buf_q); tid->sched = false;
drivers/net/wireless/b43/xmit.c +2 -2
@@ -819,10 +819,10 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)* channel number in b43. */ if (chanstat &B43_RX_CHAN_5GHZ ) { status.band =IEEE80211_BAND_5GHZ ; - status.freq =b43_freq_to_channel_5ghz (chanid); + status.freq =b43_channel_to_freq_5ghz (chanid); }else { status.band =IEEE80211_BAND_2GHZ ; - status.freq =b43_freq_to_channel_2ghz (chanid); + status.freq =b43_channel_to_freq_2ghz (chanid); }break ;default :
drivers/net/wireless/iwlwifi/iwl-agn-tx.c +11 -5
@@ -854,8 +854,6 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,struct iwl_compressed_ba_resp *ba_resp = &pkt->u.compressed_ba;struct iwl_ht_agg *agg;struct sk_buff_head reclaimed_skbs; -struct ieee80211_tx_info *info; -struct ieee80211_hdr *hdr;struct sk_buff *skb;unsigned long flags;int sta_id;
@@ -941,24 +939,32 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, 0, &reclaimed_skbs); freed =0 ;while (!skb_queue_empty (&reclaimed_skbs)) { +struct ieee80211_hdr *hdr; +struct ieee80211_tx_info *info; skb =__skb_dequeue (&reclaimed_skbs); - hdr = (struct ieee80211_hdr *)skb->data; + hdr = (void *)skb->data; + info =IEEE80211_SKB_CB (skb);if (ieee80211_is_data_qos (hdr->frame_control)) freed++;else WARN_ON_ONCE (1 ); - info =IEEE80211_SKB_CB (skb);kmem_cache_free (priv->tx_cmd_pool, (info->driver_data[1 ])); +memset (&info->status,0 ,sizeof (info->status)); +/* Packet was transmitted successfully, failures come as single +* frames because before failing a frame the firmware transmits +* it without aggregation at least once. +*/ + info->flags |=IEEE80211_TX_STAT_ACK ; +if (freed ==1 ) {/* this is the first skb we deliver in this batch */ /* put the rate scaling data there */ info =IEEE80211_SKB_CB (skb);memset (&info->status,0 ,sizeof (info->status)); - info->flags |=IEEE80211_TX_STAT_ACK ; info->flags |=IEEE80211_TX_STAT_AMPDU ; info->status.ampdu_ack_len = ba_resp->txed_2_done; info->status.ampdu_len = ba_resp->txed;
drivers/net/wireless/mwifiex/11n.c +1 -2
@@ -343,8 +343,7 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv, ht_cap->header.len =cpu_to_le16 (sizeof (struct ieee80211_ht_cap ));memcpy ((u8 *) ht_cap +sizeof (struct mwifiex_ie_types_header ), - (u8 *) bss_desc->bcn_ht_cap + -sizeof (struct ieee_types_header ), + (u8 *)bss_desc->bcn_ht_cap,le16_to_cpu (ht_cap->header.len));mwifiex_fill_cap_info (priv, radio_type, ht_cap);
drivers/net/wireless/rtl818x/rtl8187/rtl8187.h +8 -2
@@ -15,6 +15,8 @@#ifndef RTL8187_H #define RTL8187_H +#include <linux/cache.h> +#include "rtl818x.h" #include "leds.h"
@@ -131,7 +133,10 @@ struct rtl8187_priv {u8 aifsn[4 ];u8 rfkill_mask;struct { -__le64 buf; +union { +__le64 buf; +u8 dummy1[L1_CACHE_BYTES ]; + }____cacheline_aligned ;struct sk_buff_head queue; } b_tx_status;/* This queue is used by both -b and non-b devices */ struct mutex io_mutex;
@@ -139,7 +144,8 @@ struct rtl8187_priv {u8 bits8;__le16 bits16;__le32 bits32; - } *io_dmabuf; +u8 dummy2[L1_CACHE_BYTES ]; + } *io_dmabuf____cacheline_aligned ;bool rfkill_off; };
drivers/net/wireless/rtlwifi/core.c +1 -0
@@ -131,6 +131,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw, rtlpriv->cfg->maps [RTL_IBSS_INT_MASKS]); } + mac->link_state =MAC80211_LINKED ;break ;case NL80211_IFTYPE_ADHOC : RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c +16 -2
@@ -905,14 +905,26 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw)bool is92c;int err;u8 tmp_u1b; +unsigned long flags; rtlpci->being_init_adapter = true; + +/* Since this function can take a very long time (up to 350 ms) +* and can be called with irqs disabled, reenable the irqs +* to let the other devices continue being serviced. +* +* It is safe doing so since our own interrupts will only be enabled +* in a subsequent step. +*/ +local_save_flags (flags); +local_irq_enable (); + rtlpriv->intf_ops->disable_aspm (hw); rtstatus =_rtl92ce_init_mac (hw);if (rtstatus != true) {RT_TRACE (rtlpriv,COMP_ERR ,DBG_EMERG , ("Init MAC failed\n" )); err =1 ; -return err; + goto exit; } err =rtl92c_download_fw (hw);
@@ -922,7 +934,7 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw) "without FW now..\n")); err =1 ; rtlhal->fw_ready = false; -return err; + goto exit; }else { rtlhal->fw_ready = true; }
@@ -985,6 +997,8 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw)RT_TRACE (rtlpriv,COMP_INIT ,DBG_TRACE , ("under 1.5V\n" )); }rtl92c_dm_init (hw); +exit: +local_irq_restore (flags); rtlpci->being_init_adapter = false;return err; }
drivers/net/wireless/rtlwifi/rtl8192cu/rf.c +16 -13
@@ -85,17 +85,15 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,if (mac->act_scanning) { tx_agc[RF90_PATH_A ] =0x3f3f3f3f ; tx_agc[RF90_PATH_B ] =0x3f3f3f3f ; -if (turbo_scanoff) { -for (idx1 =RF90_PATH_A ; idx1 <=RF90_PATH_B ; idx1++) { - tx_agc[idx1] = ppowerlevel[idx1] | - (ppowerlevel[idx1] <<8 ) | - (ppowerlevel[idx1] <<16 ) | - (ppowerlevel[idx1] <<24 ); -if (rtlhal->interface ==INTF_USB ) { -if (tx_agc[idx1] >0x20 && - rtlefuse->external_pa) - tx_agc[idx1] =0x20 ; - } +for (idx1 =RF90_PATH_A ; idx1 <=RF90_PATH_B ; idx1++) { + tx_agc[idx1] = ppowerlevel[idx1] | + (ppowerlevel[idx1] <<8 ) | + (ppowerlevel[idx1] <<16 ) | + (ppowerlevel[idx1] <<24 ); +if (rtlhal->interface ==INTF_USB ) { +if (tx_agc[idx1] >0x20 && + rtlefuse->external_pa) + tx_agc[idx1] =0x20 ; } } }else {
@@ -107,7 +105,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, TXHIGHPWRLEVEL_LEVEL2) { tx_agc[RF90_PATH_A ] =0x00000000 ; tx_agc[RF90_PATH_B ] =0x00000000 ; - } else{ + } else {for (idx1 =RF90_PATH_A ; idx1 <=RF90_PATH_B ; idx1++) { tx_agc[idx1] = ppowerlevel[idx1] | (ppowerlevel[idx1] << 8) |
@@ -380,7 +378,12 @@ static void _rtl92c_write_ofdm_power_reg(struct ieee80211_hw *hw, regoffset == RTXAGC_B_MCS07_MCS04) regoffset =0xc98 ;for (i =0 ; i <3 ; i++) { - writeVal = (writeVal >6 ) ? (writeVal -6 ) :0 ; +if (i !=2 ) + writeVal = (writeVal >8 ) ? + (writeVal -8 ) :0 ; +else + writeVal = (writeVal >6 ) ? + (writeVal -6 ) :0 ;rtl_write_byte (rtlpriv, (u32)(regoffset + i), (u8 )writeVal); }
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +1 -0
@@ -316,6 +316,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = { {RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/ {RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ {RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ + {RTL_USB_DEVICE(0x0df6, 0x0077, rtl92cu_hal_cfg)}, /*Sitecom-WLA2100V2*/ {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ {RTL_USB_DEVICE(0x4856, 0x0091, rtl92cu_hal_cfg)}, /*NetweeN - Feixun*//* HP - Lite-On ,8188CUS Slim Combo */
drivers/of/address.c +7 -2
@@ -97,8 +97,13 @@ static unsigned int of_bus_default_get_flags(const __be32 *addr)static int of_bus_pci_match (struct device_node *np) { -/* "vci" is for the /chaos bridge on 1st-gen PCI powermacs */ -return !strcmp (np->type,"pci" ) || !strcmp (np->type,"vci" ); +/* +* "pciex" is PCI Express +* "vci" is for the /chaos bridge on 1st-gen PCI powermacs +* "ht" is hypertransport +*/ +return !strcmp (np->type,"pci" ) || !strcmp (np->type,"pciex" ) || + !strcmp (np->type,"vci" ) || !strcmp (np->type,"ht" ); } static void of_bus_pci_count_cells(struct device_node *np,
drivers/parport/parport_pc.c +2 -8
@@ -2875,8 +2875,6 @@ enum parport_pc_pci_cards { syba_2p_epp, syba_1p_ecp, titan_010l, - titan_1284p1, - titan_1284p2, avlab_1p, avlab_2p, oxsemi_952,
@@ -2935,8 +2933,6 @@ static struct parport_pc_pci { /* syba_2p_epp AP138B */ { 2, { { 0, 0x078 }, { 0, 0x178 }, } }, /* syba_1p_ecp W83787 */ { 1, { { 0, 0x078 }, } }, /* titan_010l */ { 1, { { 3, -1 }, } }, - /* titan_1284p1 */ { 1, { { 0, 1 }, } }, - /* titan_1284p2 */ { 2, { { 0, 1 }, { 2, 3 }, } }, /* avlab_1p */ { 1, { { 0, 1}, } }, /* avlab_2p */ { 2, { { 0, 1}, { 2, 3 },} }, /* The Oxford Semi cards are unusual: 954 doesn't support ECP,
@@ -2952,8 +2948,8 @@ static struct parport_pc_pci { /* netmos_9705 */ { 1, { { 0, -1 }, } }, /* netmos_9715 */ { 2, { { 0, 1 }, { 2, 3 },} }, /* netmos_9755 */ { 2, { { 0, 1 }, { 2, 3 },} }, - /* netmos_9805 */ { 1, { { 0, -1 }, } }, - /* netmos_9815 */ { 2, { { 0, -1 }, { 2, -1 }, } }, + /* netmos_9805 */ { 1, { { 0, 1 }, } }, + /* netmos_9815 */ { 2, { { 0, 1 }, { 2, 3 }, } }, /* netmos_9901 */ { 1, { { 0, -1 }, } }, /* netmos_9865 */ { 1, { { 0, -1 }, } }, /* quatech_sppxp100 */ { 1, { { 0, 1 }, } },
Lines of this file are not shown. View the raw message.
drivers/rtc/rtc-cmos.c +51 -1
52 lines not on this page · raw message
drivers/staging/comedi/drivers/adv_pci1710.c +12 -5
Lines of this file are not shown. View the raw message.
drivers/staging/comedi/drivers/pcmuio.c +6 -6
Lines of this file are not shown. View the raw message.
drivers/staging/comedi/drivers/ssv_dnp.c +3 -3
Lines of this file are not shown. View the raw message.
fs/hpfs/alloc.c +64 -2
66 lines not on this page · raw message
fs/nfs/nfs4xdr.c +31 -16
47 lines not on this page · raw message
kernel/trace/ftrace.c +73 -8
81 lines not on this page · raw message
net/sctp/socket.c +32 -9
41 lines not on this page · raw message
security/selinux/hooks.c +35 -7
42 lines not on this page · raw message
sound/soc/codecs/sta32x.c +37 -37
74 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Quoted 8 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.56 release. There are 200 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Apr 02 00:00:00 UTC 2014. Anything received after that time might be too late.
Build results:
total: 116 pass: 87 skipped: 22 fail: 7
Qemu tests all passed. Results are as expected.
Details are available at http://server.roeck-us.net:8010/builders.
Guenter
Quoted 9 lines · Guenter Roeck
Quoted 8 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.56 release. There are 200 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Apr 02 00:00:00 UTC 2014. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 116 pass: 87 skipped: 22 fail: 7Qemu tests all passed. Results are as expected.
Details are available at http://server.roeck-us.net:8010/builders.
Thanks Guenter.
Ben.
Signature · 2 lines
Ben Hutchings friends: People who know you well, but like you anyway.
Quoted 10 lines · Ben Hutchings
Quoted 9 lines · Guenter Roeck
Quoted 8 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.56 release. There are 200 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Apr 02 00:00:00 UTC 2014. Anything received after that time might be too late.
Quoted 7 lines
Quoted 6 lines
Build results:
total: 116 pass: 87 skipped: 22 fail: 7Qemu tests all passed. Results are as expected.
Details are available at http://server.roeck-us.net:8010/builders.
My pleasure.
Just for completeness ... everything still builds after you dropped a patch. qemu tests are also still ok.
Guenter
At Sun, 30 Mar 2014 17:49:46 -0700,
Quoted 10 lines · Guenter Roeck
Quoted 8 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.56 release. There are 200 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Apr 02 00:00:00 UTC 2014. Anything received after that time might be too late.
Quoted 8 lines
Build results:
total: 116 pass: 87 skipped: 22 fail: 7Qemu tests all passed. Results are as expected.
Details are available at http://server.roeck-us.net:8010/builders.
Guenter
This kernel passed my test.
- Test Cases:
- Build this kernel.
- Boot this kernel.
- Build the latest mainline kernel with this kernel.
- Test Tool:
https://github.com/satoru-takeuchi/test-linux-stable
- Test Result (kernel .config, ktest config and test log):
http://satoru-takeuchi.org/test-linux-stable/results/<version>-<test datetime>.tar.xz
- Build Environment:
- OS: Debian Jessy x86_64
- CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
- memory: 8GB
- Test Target Environment:
- Debian Jessy x86_64 (KVM guest on the Build Environment)
- # of vCPU: 2
- memory: 2GB
Thanks,
Satoru
Quoted 15 lines · Satoru Takeuchi
At Sun, 30 Mar 2014 17:49:46 -0700,
Quoted 13 lines · Guenter Roeck
Quoted 8 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.56 release. There are 200 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Apr 02 00:00:00 UTC 2014. Anything received after that time might be too late.
Build results:
total: 116 pass: 87 skipped: 22 fail: 7
Quoted 7 lines
Quoted 5 lines
Qemu tests all passed. Results are as expected.
Details are available at http://server.roeck-us.net:8010/builders.
Guenter
This kernel passed my test.
[...]
Thanks.
Ben.
Signature · 2 lines
Ben Hutchings Computers are not intelligent. They only think they are.