Skip to content

Commit f64001e

Browse files
committed
Merge tag 'char-misc-3.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH: "Nothing huge, just a few small bugfixes for problems reported, and a device id update" * tag 'char-misc-3.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: mei: add 9 series PCH mei device ids drivers/char/i8k.c: add Dell XPLS L421X MAINTAINERS: add HSI subsystem misc: mic: Suppress memory space sparse warnings misc: mic: Fix endianness issues. misc: mic: Fix user space namespace pollution from mic_common.h. misc: mic: Bug fix for sysfs poll usage. misc: mic: Minor bug fix in 'retry' loops. misc: mic: Change mic_notify(...) to return true. extcon: remove freed groups caused the panic or warning in unregister flow extcon: arizona: Get pdata from arizona structure not device
2 parents b19d69c + 76a9635 commit f64001e

14 files changed

Lines changed: 97 additions & 73 deletions

File tree

‎CREDITS‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,11 @@ S: Stanford University
655655
S: Stanford, California 94305
656656
S: USA
657657

658+
N: Carlos Chinea
659+
E: carlos.chinea@nokia.com
660+
E: cch.devel@gmail.com
661+
D: Author of HSI Subsystem
662+
658663
N: Randolph Chung
659664
E: tausq@debian.org
660665
D: Linux/PA-RISC hacker

‎Documentation/mic/mpssd/mpssd.c‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static struct mic_device_desc *get_device_desc(struct mic_info *mic, int type)
313313
int i;
314314
void *dp = get_dp(mic, type);
315315

316-
for (i = mic_aligned_size(struct mic_bootparam); i < PAGE_SIZE;
316+
for (i = sizeof(struct mic_bootparam); i < PAGE_SIZE;
317317
i += mic_total_desc_size(d)) {
318318
d = dp + i;
319319

@@ -445,8 +445,8 @@ init_vr(struct mic_info *mic, int fd, int type,
445445
__func__, mic->name, vr0->va, vr0->info, vr_size,
446446
vring_size(MIC_VRING_ENTRIES, MIC_VIRTIO_RING_ALIGN));
447447
mpsslog("magic 0x%x expected 0x%x\n",
448-
vr0->info->magic, MIC_MAGIC + type);
449-
assert(vr0->info->magic == MIC_MAGIC + type);
448+
le32toh(vr0->info->magic), MIC_MAGIC + type);
449+
assert(le32toh(vr0->info->magic) == MIC_MAGIC + type);
450450
if (vr1) {
451451
vr1->va = (struct mic_vring *)
452452
&va[MIC_DEVICE_PAGE_END + vr_size];
@@ -458,8 +458,8 @@ init_vr(struct mic_info *mic, int fd, int type,
458458
__func__, mic->name, vr1->va, vr1->info, vr_size,
459459
vring_size(MIC_VRING_ENTRIES, MIC_VIRTIO_RING_ALIGN));
460460
mpsslog("magic 0x%x expected 0x%x\n",
461-
vr1->info->magic, MIC_MAGIC + type + 1);
462-
assert(vr1->info->magic == MIC_MAGIC + type + 1);
461+
le32toh(vr1->info->magic), MIC_MAGIC + type + 1);
462+
assert(le32toh(vr1->info->magic) == MIC_MAGIC + type + 1);
463463
}
464464
done:
465465
return va;
@@ -520,7 +520,7 @@ static void *
520520
virtio_net(void *arg)
521521
{
522522
static __u8 vnet_hdr[2][sizeof(struct virtio_net_hdr)];
523-
static __u8 vnet_buf[2][MAX_NET_PKT_SIZE] __aligned(64);
523+
static __u8 vnet_buf[2][MAX_NET_PKT_SIZE] __attribute__ ((aligned(64)));
524524
struct iovec vnet_iov[2][2] = {
525525
{ { .iov_base = vnet_hdr[0], .iov_len = sizeof(vnet_hdr[0]) },
526526
{ .iov_base = vnet_buf[0], .iov_len = sizeof(vnet_buf[0]) } },
@@ -1412,6 +1412,12 @@ mic_config(void *arg)
14121412
}
14131413

14141414
do {
1415+
ret = lseek(fd, 0, SEEK_SET);
1416+
if (ret < 0) {
1417+
mpsslog("%s: Failed to seek to file start '%s': %s\n",
1418+
mic->name, pathname, strerror(errno));
1419+
goto close_error1;
1420+
}
14151421
ret = read(fd, value, sizeof(value));
14161422
if (ret < 0) {
14171423
mpsslog("%s: Failed to read sysfs entry '%s': %s\n",

‎MAINTAINERS‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4045,6 +4045,14 @@ W: http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi
40454045
S: Maintained
40464046
F: fs/hpfs/
40474047

4048+
HSI SUBSYSTEM
4049+
M: Sebastian Reichel <sre@debian.org>
4050+
S: Maintained
4051+
F: Documentation/ABI/testing/sysfs-bus-hsi
4052+
F: drivers/hsi/
4053+
F: include/linux/hsi/
4054+
F: include/uapi/linux/hsi/
4055+
40484056
HSO 3G MODEM DRIVER
40494057
M: Jan Dumon <j.dumon@option.com>
40504058
W: http://www.pharscape.org

‎drivers/char/i8k.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,13 @@ static struct dmi_system_id __initdata i8k_dmi_table[] = {
664664
DMI_MATCH(DMI_PRODUCT_NAME, "Vostro"),
665665
},
666666
},
667+
{
668+
.ident = "Dell XPS421",
669+
.matches = {
670+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
671+
DMI_MATCH(DMI_PRODUCT_NAME, "XPS L421X"),
672+
},
673+
},
667674
{ }
668675
};
669676

‎drivers/extcon/extcon-arizona.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ static void arizona_micd_set_level(struct arizona *arizona, int index,
10821082
static int arizona_extcon_probe(struct platform_device *pdev)
10831083
{
10841084
struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
1085-
struct arizona_pdata *pdata;
1085+
struct arizona_pdata *pdata = &arizona->pdata;
10861086
struct arizona_extcon_info *info;
10871087
unsigned int val;
10881088
int jack_irq_fall, jack_irq_rise;
@@ -1091,8 +1091,6 @@ static int arizona_extcon_probe(struct platform_device *pdev)
10911091
if (!arizona->dapm || !arizona->dapm->card)
10921092
return -EPROBE_DEFER;
10931093

1094-
pdata = dev_get_platdata(arizona->dev);
1095-
10961094
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
10971095
if (!info) {
10981096
dev_err(&pdev->dev, "Failed to allocate memory\n");

‎drivers/extcon/extcon-class.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,8 @@ void extcon_dev_unregister(struct extcon_dev *edev)
792792
return;
793793
}
794794

795+
device_unregister(&edev->dev);
796+
795797
if (edev->mutually_exclusive && edev->max_supported) {
796798
for (index = 0; edev->mutually_exclusive[index];
797799
index++)
@@ -812,7 +814,6 @@ void extcon_dev_unregister(struct extcon_dev *edev)
812814
if (switch_class)
813815
class_compat_remove_link(switch_class, &edev->dev, NULL);
814816
#endif
815-
device_unregister(&edev->dev);
816817
put_device(&edev->dev);
817818
}
818819
EXPORT_SYMBOL_GPL(extcon_dev_unregister);

‎drivers/misc/mei/hw-me-regs.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,12 @@
109109
#define MEI_DEV_ID_PPT_2 0x1CBA /* Panther Point */
110110
#define MEI_DEV_ID_PPT_3 0x1DBA /* Panther Point */
111111

112-
#define MEI_DEV_ID_LPT 0x8C3A /* Lynx Point */
112+
#define MEI_DEV_ID_LPT_H 0x8C3A /* Lynx Point H */
113113
#define MEI_DEV_ID_LPT_W 0x8D3A /* Lynx Point - Wellsburg */
114114
#define MEI_DEV_ID_LPT_LP 0x9C3A /* Lynx Point LP */
115+
#define MEI_DEV_ID_LPT_HR 0x8CBA /* Lynx Point H Refresh */
116+
117+
#define MEI_DEV_ID_WPT_LP 0x9CBA /* Wildcat Point LP */
115118
/*
116119
* MEI HW Section
117120
*/

‎drivers/misc/mei/pci-me.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ static DEFINE_PCI_DEVICE_TABLE(mei_me_pci_tbl) = {
7676
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_PPT_1)},
7777
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_PPT_2)},
7878
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_PPT_3)},
79-
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT)},
79+
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_H)},
8080
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_W)},
8181
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_LP)},
82+
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_HR)},
83+
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_WPT_LP)},
8284

8385
/* required last entry */
8486
{0, }

‎drivers/misc/mic/card/mic_virtio.c‎

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ static void mic_reset_inform_host(struct virtio_device *vdev)
154154
{
155155
struct mic_vdev *mvdev = to_micvdev(vdev);
156156
struct mic_device_ctrl __iomem *dc = mvdev->dc;
157-
int retry = 100, i;
157+
int retry;
158158

159159
iowrite8(0, &dc->host_ack);
160160
iowrite8(1, &dc->vdev_reset);
161161
mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db);
162162

163163
/* Wait till host completes all card accesses and acks the reset */
164-
for (i = retry; i--;) {
164+
for (retry = 100; retry--;) {
165165
if (ioread8(&dc->host_ack))
166166
break;
167167
msleep(100);
@@ -187,11 +187,12 @@ static void mic_reset(struct virtio_device *vdev)
187187
/*
188188
* The virtio_ring code calls this API when it wants to notify the Host.
189189
*/
190-
static void mic_notify(struct virtqueue *vq)
190+
static bool mic_notify(struct virtqueue *vq)
191191
{
192192
struct mic_vdev *mvdev = vq->priv;
193193

194194
mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db);
195+
return true;
195196
}
196197

197198
static void mic_del_vq(struct virtqueue *vq, int n)
@@ -247,17 +248,17 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev,
247248
/* First assign the vring's allocated in host memory */
248249
vqconfig = mic_vq_config(mvdev->desc) + index;
249250
memcpy_fromio(&config, vqconfig, sizeof(config));
250-
_vr_size = vring_size(config.num, MIC_VIRTIO_RING_ALIGN);
251+
_vr_size = vring_size(le16_to_cpu(config.num), MIC_VIRTIO_RING_ALIGN);
251252
vr_size = PAGE_ALIGN(_vr_size + sizeof(struct _mic_vring_info));
252-
va = mic_card_map(mvdev->mdev, config.address, vr_size);
253+
va = mic_card_map(mvdev->mdev, le64_to_cpu(config.address), vr_size);
253254
if (!va)
254255
return ERR_PTR(-ENOMEM);
255256
mvdev->vr[index] = va;
256257
memset_io(va, 0x0, _vr_size);
257-
vq = vring_new_virtqueue(index,
258-
config.num, MIC_VIRTIO_RING_ALIGN, vdev,
259-
false,
260-
va, mic_notify, callback, name);
258+
vq = vring_new_virtqueue(index, le16_to_cpu(config.num),
259+
MIC_VIRTIO_RING_ALIGN, vdev, false,
260+
(void __force *)va, mic_notify, callback,
261+
name);
261262
if (!vq) {
262263
err = -ENOMEM;
263264
goto unmap;
@@ -272,7 +273,8 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev,
272273

273274
/* Allocate and reassign used ring now */
274275
mvdev->used_size[index] = PAGE_ALIGN(sizeof(__u16) * 3 +
275-
sizeof(struct vring_used_elem) * config.num);
276+
sizeof(struct vring_used_elem) *
277+
le16_to_cpu(config.num));
276278
used = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
277279
get_order(mvdev->used_size[index]));
278280
if (!used) {
@@ -309,7 +311,7 @@ static int mic_find_vqs(struct virtio_device *vdev, unsigned nvqs,
309311
{
310312
struct mic_vdev *mvdev = to_micvdev(vdev);
311313
struct mic_device_ctrl __iomem *dc = mvdev->dc;
312-
int i, err, retry = 100;
314+
int i, err, retry;
313315

314316
/* We must have this many virtqueues. */
315317
if (nvqs > ioread8(&mvdev->desc->num_vq))
@@ -331,7 +333,7 @@ static int mic_find_vqs(struct virtio_device *vdev, unsigned nvqs,
331333
* rings have been re-assigned.
332334
*/
333335
mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db);
334-
for (i = retry; i--;) {
336+
for (retry = 100; retry--;) {
335337
if (!ioread8(&dc->used_address_updated))
336338
break;
337339
msleep(100);
@@ -519,8 +521,8 @@ static void mic_scan_devices(struct mic_driver *mdrv, bool remove)
519521
struct device *dev;
520522
int ret;
521523

522-
for (i = mic_aligned_size(struct mic_bootparam);
523-
i < MIC_DP_SIZE; i += mic_total_desc_size(d)) {
524+
for (i = sizeof(struct mic_bootparam); i < MIC_DP_SIZE;
525+
i += mic_total_desc_size(d)) {
524526
d = mdrv->dp + i;
525527
dc = (void __iomem *)d + mic_aligned_desc_size(d);
526528
/*
@@ -539,7 +541,8 @@ static void mic_scan_devices(struct mic_driver *mdrv, bool remove)
539541
continue;
540542

541543
/* device already exists */
542-
dev = device_find_child(mdrv->dev, d, mic_match_desc);
544+
dev = device_find_child(mdrv->dev, (void __force *)d,
545+
mic_match_desc);
543546
if (dev) {
544547
if (remove)
545548
iowrite8(MIC_VIRTIO_PARAM_DEV_REMOVE,

‎drivers/misc/mic/card/mic_virtio.h‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242

4343
static inline unsigned mic_desc_size(struct mic_device_desc __iomem *desc)
4444
{
45-
return mic_aligned_size(*desc)
46-
+ ioread8(&desc->num_vq) * mic_aligned_size(struct mic_vqconfig)
45+
return sizeof(*desc)
46+
+ ioread8(&desc->num_vq) * sizeof(struct mic_vqconfig)
4747
+ ioread8(&desc->feature_len) * 2
4848
+ ioread8(&desc->config_len);
4949
}
@@ -67,8 +67,7 @@ mic_vq_configspace(struct mic_device_desc __iomem *desc)
6767
}
6868
static inline unsigned mic_total_desc_size(struct mic_device_desc __iomem *desc)
6969
{
70-
return mic_aligned_desc_size(desc) +
71-
mic_aligned_size(struct mic_device_ctrl);
70+
return mic_aligned_desc_size(desc) + sizeof(struct mic_device_ctrl);
7271
}
7372

7473
int mic_devices_init(struct mic_driver *mdrv);

0 commit comments

Comments
 (0)