Skip to content

Commit 3e3ab9c

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Signed-off-by: David S. Miller <[email protected]>
2 parents 868c36d + ba804bb commit 3e3ab9c

File tree

28 files changed

+346
-220
lines changed

28 files changed

+346
-220
lines changed

arch/s390/kvm/kvm-s390.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ static void kvm_s390_sync_request_broadcast(struct kvm *kvm, int req)
769769

770770
/*
771771
* Must be called with kvm->srcu held to avoid races on memslots, and with
772-
* kvm->lock to avoid races with ourselves and kvm_s390_vm_stop_migration.
772+
* kvm->slots_lock to avoid races with ourselves and kvm_s390_vm_stop_migration.
773773
*/
774774
static int kvm_s390_vm_start_migration(struct kvm *kvm)
775775
{
@@ -825,7 +825,7 @@ static int kvm_s390_vm_start_migration(struct kvm *kvm)
825825
}
826826

827827
/*
828-
* Must be called with kvm->lock to avoid races with ourselves and
828+
* Must be called with kvm->slots_lock to avoid races with ourselves and
829829
* kvm_s390_vm_start_migration.
830830
*/
831831
static int kvm_s390_vm_stop_migration(struct kvm *kvm)
@@ -840,6 +840,8 @@ static int kvm_s390_vm_stop_migration(struct kvm *kvm)
840840

841841
if (kvm->arch.use_cmma) {
842842
kvm_s390_sync_request_broadcast(kvm, KVM_REQ_STOP_MIGRATION);
843+
/* We have to wait for the essa emulation to finish */
844+
synchronize_srcu(&kvm->srcu);
843845
vfree(mgs->pgste_bitmap);
844846
}
845847
kfree(mgs);
@@ -849,22 +851,20 @@ static int kvm_s390_vm_stop_migration(struct kvm *kvm)
849851
static int kvm_s390_vm_set_migration(struct kvm *kvm,
850852
struct kvm_device_attr *attr)
851853
{
852-
int idx, res = -ENXIO;
854+
int res = -ENXIO;
853855

854-
mutex_lock(&kvm->lock);
856+
mutex_lock(&kvm->slots_lock);
855857
switch (attr->attr) {
856858
case KVM_S390_VM_MIGRATION_START:
857-
idx = srcu_read_lock(&kvm->srcu);
858859
res = kvm_s390_vm_start_migration(kvm);
859-
srcu_read_unlock(&kvm->srcu, idx);
860860
break;
861861
case KVM_S390_VM_MIGRATION_STOP:
862862
res = kvm_s390_vm_stop_migration(kvm);
863863
break;
864864
default:
865865
break;
866866
}
867-
mutex_unlock(&kvm->lock);
867+
mutex_unlock(&kvm->slots_lock);
868868

869869
return res;
870870
}
@@ -1754,7 +1754,9 @@ long kvm_arch_vm_ioctl(struct file *filp,
17541754
r = -EFAULT;
17551755
if (copy_from_user(&args, argp, sizeof(args)))
17561756
break;
1757+
mutex_lock(&kvm->slots_lock);
17571758
r = kvm_s390_get_cmma_bits(kvm, &args);
1759+
mutex_unlock(&kvm->slots_lock);
17581760
if (!r) {
17591761
r = copy_to_user(argp, &args, sizeof(args));
17601762
if (r)
@@ -1768,7 +1770,9 @@ long kvm_arch_vm_ioctl(struct file *filp,
17681770
r = -EFAULT;
17691771
if (copy_from_user(&args, argp, sizeof(args)))
17701772
break;
1773+
mutex_lock(&kvm->slots_lock);
17711774
r = kvm_s390_set_cmma_bits(kvm, &args);
1775+
mutex_unlock(&kvm->slots_lock);
17721776
break;
17731777
}
17741778
default:

drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ nvkm_pci_intr(int irq, void *arg)
7171
struct nvkm_pci *pci = arg;
7272
struct nvkm_device *device = pci->subdev.device;
7373
bool handled = false;
74+
75+
if (pci->irq < 0)
76+
return IRQ_HANDLED;
77+
7478
nvkm_mc_intr_unarm(device);
7579
if (pci->msi)
7680
pci->func->msi_rearm(pci);
@@ -84,11 +88,6 @@ nvkm_pci_fini(struct nvkm_subdev *subdev, bool suspend)
8488
{
8589
struct nvkm_pci *pci = nvkm_pci(subdev);
8690

87-
if (pci->irq >= 0) {
88-
free_irq(pci->irq, pci);
89-
pci->irq = -1;
90-
}
91-
9291
if (pci->agp.bridge)
9392
nvkm_agp_fini(pci);
9493

@@ -108,16 +107,27 @@ static int
108107
nvkm_pci_oneinit(struct nvkm_subdev *subdev)
109108
{
110109
struct nvkm_pci *pci = nvkm_pci(subdev);
111-
if (pci_is_pcie(pci->pdev))
112-
return nvkm_pcie_oneinit(pci);
110+
struct pci_dev *pdev = pci->pdev;
111+
int ret;
112+
113+
if (pci_is_pcie(pci->pdev)) {
114+
ret = nvkm_pcie_oneinit(pci);
115+
if (ret)
116+
return ret;
117+
}
118+
119+
ret = request_irq(pdev->irq, nvkm_pci_intr, IRQF_SHARED, "nvkm", pci);
120+
if (ret)
121+
return ret;
122+
123+
pci->irq = pdev->irq;
113124
return 0;
114125
}
115126

116127
static int
117128
nvkm_pci_init(struct nvkm_subdev *subdev)
118129
{
119130
struct nvkm_pci *pci = nvkm_pci(subdev);
120-
struct pci_dev *pdev = pci->pdev;
121131
int ret;
122132

123133
if (pci->agp.bridge) {
@@ -131,28 +141,34 @@ nvkm_pci_init(struct nvkm_subdev *subdev)
131141
if (pci->func->init)
132142
pci->func->init(pci);
133143

134-
ret = request_irq(pdev->irq, nvkm_pci_intr, IRQF_SHARED, "nvkm", pci);
135-
if (ret)
136-
return ret;
137-
138-
pci->irq = pdev->irq;
139-
140144
/* Ensure MSI interrupts are armed, for the case where there are
141145
* already interrupts pending (for whatever reason) at load time.
142146
*/
143147
if (pci->msi)
144148
pci->func->msi_rearm(pci);
145149

146-
return ret;
150+
return 0;
147151
}
148152

149153
static void *
150154
nvkm_pci_dtor(struct nvkm_subdev *subdev)
151155
{
152156
struct nvkm_pci *pci = nvkm_pci(subdev);
157+
153158
nvkm_agp_dtor(pci);
159+
160+
if (pci->irq >= 0) {
161+
/* freq_irq() will call the handler, we use pci->irq == -1
162+
* to signal that it's been torn down and should be a noop.
163+
*/
164+
int irq = pci->irq;
165+
pci->irq = -1;
166+
free_irq(irq, pci);
167+
}
168+
154169
if (pci->msi)
155170
pci_disable_msi(pci->pdev);
171+
156172
return nvkm_pci(subdev);
157173
}
158174

drivers/gpu/drm/vc4/vc4_gem.c

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ vc4_save_hang_state(struct drm_device *dev)
146146
struct vc4_exec_info *exec[2];
147147
struct vc4_bo *bo;
148148
unsigned long irqflags;
149-
unsigned int i, j, unref_list_count, prev_idx;
149+
unsigned int i, j, k, unref_list_count;
150150

151151
kernel_state = kcalloc(1, sizeof(*kernel_state), GFP_KERNEL);
152152
if (!kernel_state)
@@ -182,7 +182,7 @@ vc4_save_hang_state(struct drm_device *dev)
182182
return;
183183
}
184184

185-
prev_idx = 0;
185+
k = 0;
186186
for (i = 0; i < 2; i++) {
187187
if (!exec[i])
188188
continue;
@@ -197,20 +197,20 @@ vc4_save_hang_state(struct drm_device *dev)
197197
WARN_ON(!refcount_read(&bo->usecnt));
198198
refcount_inc(&bo->usecnt);
199199
drm_gem_object_get(&exec[i]->bo[j]->base);
200-
kernel_state->bo[j + prev_idx] = &exec[i]->bo[j]->base;
200+
kernel_state->bo[k++] = &exec[i]->bo[j]->base;
201201
}
202202

203203
list_for_each_entry(bo, &exec[i]->unref_list, unref_head) {
204204
/* No need to retain BOs coming from the ->unref_list
205205
* because they are naturally unpurgeable.
206206
*/
207207
drm_gem_object_get(&bo->base.base);
208-
kernel_state->bo[j + prev_idx] = &bo->base.base;
209-
j++;
208+
kernel_state->bo[k++] = &bo->base.base;
210209
}
211-
prev_idx = j + 1;
212210
}
213211

212+
WARN_ON_ONCE(k != state->bo_count);
213+
214214
if (exec[0])
215215
state->start_bin = exec[0]->ct0ca;
216216
if (exec[1])
@@ -436,6 +436,19 @@ vc4_flush_caches(struct drm_device *dev)
436436
VC4_SET_FIELD(0xf, V3D_SLCACTL_ICC));
437437
}
438438

439+
static void
440+
vc4_flush_texture_caches(struct drm_device *dev)
441+
{
442+
struct vc4_dev *vc4 = to_vc4_dev(dev);
443+
444+
V3D_WRITE(V3D_L2CACTL,
445+
V3D_L2CACTL_L2CCLR);
446+
447+
V3D_WRITE(V3D_SLCACTL,
448+
VC4_SET_FIELD(0xf, V3D_SLCACTL_T1CC) |
449+
VC4_SET_FIELD(0xf, V3D_SLCACTL_T0CC));
450+
}
451+
439452
/* Sets the registers for the next job to be actually be executed in
440453
* the hardware.
441454
*
@@ -474,6 +487,14 @@ vc4_submit_next_render_job(struct drm_device *dev)
474487
if (!exec)
475488
return;
476489

490+
/* A previous RCL may have written to one of our textures, and
491+
* our full cache flush at bin time may have occurred before
492+
* that RCL completed. Flush the texture cache now, but not
493+
* the instructions or uniforms (since we don't write those
494+
* from an RCL).
495+
*/
496+
vc4_flush_texture_caches(dev);
497+
477498
submit_cl(dev, 1, exec->ct1ca, exec->ct1ea);
478499
}
479500

drivers/infiniband/ulp/ipoib/ipoib_cm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,8 +1456,7 @@ void ipoib_cm_skb_too_long(struct net_device *dev, struct sk_buff *skb,
14561456
struct ipoib_dev_priv *priv = ipoib_priv(dev);
14571457
int e = skb_queue_empty(&priv->cm.skb_queue);
14581458

1459-
if (skb_dst(skb))
1460-
skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, skb, mtu);
1459+
skb_dst_update_pmtu(skb, mtu);
14611460

14621461
skb_queue_tail(&priv->cm.skb_queue, skb);
14631462
if (e)

drivers/input/joystick/xpad.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ static const struct xpad_device {
229229
{ 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
230230
{ 0x0e6f, 0x021f, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
231231
{ 0x0e6f, 0x0246, "Rock Candy Gamepad for Xbox One 2015", 0, XTYPE_XBOXONE },
232+
{ 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE },
232233
{ 0x0e6f, 0x0301, "Logic3 Controller", 0, XTYPE_XBOX360 },
233234
{ 0x0e6f, 0x0346, "Rock Candy Gamepad for Xbox One 2016", 0, XTYPE_XBOXONE },
234235
{ 0x0e6f, 0x0401, "Logic3 Controller", 0, XTYPE_XBOX360 },
@@ -475,6 +476,22 @@ static const u8 xboxone_hori_init[] = {
475476
0x00, 0x00, 0x00, 0x80, 0x00
476477
};
477478

479+
/*
480+
* This packet is required for some of the PDP pads to start
481+
* sending input reports. One of those pads is (0x0e6f:0x02ab).
482+
*/
483+
static const u8 xboxone_pdp_init1[] = {
484+
0x0a, 0x20, 0x00, 0x03, 0x00, 0x01, 0x14
485+
};
486+
487+
/*
488+
* This packet is required for some of the PDP pads to start
489+
* sending input reports. One of those pads is (0x0e6f:0x02ab).
490+
*/
491+
static const u8 xboxone_pdp_init2[] = {
492+
0x06, 0x20, 0x00, 0x02, 0x01, 0x00
493+
};
494+
478495
/*
479496
* A specific rumble packet is required for some PowerA pads to start
480497
* sending input reports. One of those pads is (0x24c6:0x543a).
@@ -505,6 +522,8 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {
505522
XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init),
506523
XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init),
507524
XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init),
525+
XBOXONE_INIT_PKT(0x0e6f, 0x02ab, xboxone_pdp_init1),
526+
XBOXONE_INIT_PKT(0x0e6f, 0x02ab, xboxone_pdp_init2),
508527
XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
509528
XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumblebegin_init),
510529
XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init),

0 commit comments

Comments
 (0)