Skip to content

Commit

Permalink
Merge tag 'char-misc-3.13-rc3' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Linus Torvalds committed Dec 9, 2013
2 parents b19d69c + 76a9635 commit f64001e
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 73 deletions.
5 changes: 5 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,11 @@ S: Stanford University
S: Stanford, California 94305
S: USA

N: Carlos Chinea
E: carlos.chinea@nokia.com
E: cch.devel@gmail.com
D: Author of HSI Subsystem

N: Randolph Chung
E: tausq@debian.org
D: Linux/PA-RISC hacker
Expand Down
18 changes: 12 additions & 6 deletions Documentation/mic/mpssd/mpssd.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static struct mic_device_desc *get_device_desc(struct mic_info *mic, int type)
int i;
void *dp = get_dp(mic, type);

for (i = mic_aligned_size(struct mic_bootparam); i < PAGE_SIZE;
for (i = sizeof(struct mic_bootparam); i < PAGE_SIZE;
i += mic_total_desc_size(d)) {
d = dp + i;

Expand Down Expand Up @@ -445,8 +445,8 @@ init_vr(struct mic_info *mic, int fd, int type,
__func__, mic->name, vr0->va, vr0->info, vr_size,
vring_size(MIC_VRING_ENTRIES, MIC_VIRTIO_RING_ALIGN));
mpsslog("magic 0x%x expected 0x%x\n",
vr0->info->magic, MIC_MAGIC + type);
assert(vr0->info->magic == MIC_MAGIC + type);
le32toh(vr0->info->magic), MIC_MAGIC + type);
assert(le32toh(vr0->info->magic) == MIC_MAGIC + type);
if (vr1) {
vr1->va = (struct mic_vring *)
&va[MIC_DEVICE_PAGE_END + vr_size];
Expand All @@ -458,8 +458,8 @@ init_vr(struct mic_info *mic, int fd, int type,
__func__, mic->name, vr1->va, vr1->info, vr_size,
vring_size(MIC_VRING_ENTRIES, MIC_VIRTIO_RING_ALIGN));
mpsslog("magic 0x%x expected 0x%x\n",
vr1->info->magic, MIC_MAGIC + type + 1);
assert(vr1->info->magic == MIC_MAGIC + type + 1);
le32toh(vr1->info->magic), MIC_MAGIC + type + 1);
assert(le32toh(vr1->info->magic) == MIC_MAGIC + type + 1);
}
done:
return va;
Expand Down Expand Up @@ -520,7 +520,7 @@ static void *
virtio_net(void *arg)
{
static __u8 vnet_hdr[2][sizeof(struct virtio_net_hdr)];
static __u8 vnet_buf[2][MAX_NET_PKT_SIZE] __aligned(64);
static __u8 vnet_buf[2][MAX_NET_PKT_SIZE] __attribute__ ((aligned(64)));
struct iovec vnet_iov[2][2] = {
{ { .iov_base = vnet_hdr[0], .iov_len = sizeof(vnet_hdr[0]) },
{ .iov_base = vnet_buf[0], .iov_len = sizeof(vnet_buf[0]) } },
Expand Down Expand Up @@ -1412,6 +1412,12 @@ mic_config(void *arg)
}

do {
ret = lseek(fd, 0, SEEK_SET);
if (ret < 0) {
mpsslog("%s: Failed to seek to file start '%s': %s\n",
mic->name, pathname, strerror(errno));
goto close_error1;
}
ret = read(fd, value, sizeof(value));
if (ret < 0) {
mpsslog("%s: Failed to read sysfs entry '%s': %s\n",
Expand Down
8 changes: 8 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4045,6 +4045,14 @@ W: http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi
S: Maintained
F: fs/hpfs/

HSI SUBSYSTEM
M: Sebastian Reichel <sre@debian.org>
S: Maintained
F: Documentation/ABI/testing/sysfs-bus-hsi
F: drivers/hsi/
F: include/linux/hsi/
F: include/uapi/linux/hsi/

HSO 3G MODEM DRIVER
M: Jan Dumon <j.dumon@option.com>
W: http://www.pharscape.org
Expand Down
7 changes: 7 additions & 0 deletions drivers/char/i8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,13 @@ static struct dmi_system_id __initdata i8k_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Vostro"),
},
},
{
.ident = "Dell XPS421",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "XPS L421X"),
},
},
{ }
};

Expand Down
4 changes: 1 addition & 3 deletions drivers/extcon/extcon-arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ static void arizona_micd_set_level(struct arizona *arizona, int index,
static int arizona_extcon_probe(struct platform_device *pdev)
{
struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
struct arizona_pdata *pdata;
struct arizona_pdata *pdata = &arizona->pdata;
struct arizona_extcon_info *info;
unsigned int val;
int jack_irq_fall, jack_irq_rise;
Expand All @@ -1091,8 +1091,6 @@ static int arizona_extcon_probe(struct platform_device *pdev)
if (!arizona->dapm || !arizona->dapm->card)
return -EPROBE_DEFER;

pdata = dev_get_platdata(arizona->dev);

info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
if (!info) {
dev_err(&pdev->dev, "Failed to allocate memory\n");
Expand Down
3 changes: 2 additions & 1 deletion drivers/extcon/extcon-class.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,8 @@ void extcon_dev_unregister(struct extcon_dev *edev)
return;
}

device_unregister(&edev->dev);

if (edev->mutually_exclusive && edev->max_supported) {
for (index = 0; edev->mutually_exclusive[index];
index++)
Expand All @@ -812,7 +814,6 @@ void extcon_dev_unregister(struct extcon_dev *edev)
if (switch_class)
class_compat_remove_link(switch_class, &edev->dev, NULL);
#endif
device_unregister(&edev->dev);
put_device(&edev->dev);
}
EXPORT_SYMBOL_GPL(extcon_dev_unregister);
Expand Down
5 changes: 4 additions & 1 deletion drivers/misc/mei/hw-me-regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,12 @@
#define MEI_DEV_ID_PPT_2 0x1CBA /* Panther Point */
#define MEI_DEV_ID_PPT_3 0x1DBA /* Panther Point */

#define MEI_DEV_ID_LPT 0x8C3A /* Lynx Point */
#define MEI_DEV_ID_LPT_H 0x8C3A /* Lynx Point H */
#define MEI_DEV_ID_LPT_W 0x8D3A /* Lynx Point - Wellsburg */
#define MEI_DEV_ID_LPT_LP 0x9C3A /* Lynx Point LP */
#define MEI_DEV_ID_LPT_HR 0x8CBA /* Lynx Point H Refresh */

#define MEI_DEV_ID_WPT_LP 0x9CBA /* Wildcat Point LP */
/*
* MEI HW Section
*/
Expand Down
4 changes: 3 additions & 1 deletion drivers/misc/mei/pci-me.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ static DEFINE_PCI_DEVICE_TABLE(mei_me_pci_tbl) = {
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_PPT_1)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_PPT_2)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_PPT_3)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_H)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_W)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_LP)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_HR)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_WPT_LP)},

/* required last entry */
{0, }
Expand Down
33 changes: 18 additions & 15 deletions drivers/misc/mic/card/mic_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ static void mic_reset_inform_host(struct virtio_device *vdev)
{
struct mic_vdev *mvdev = to_micvdev(vdev);
struct mic_device_ctrl __iomem *dc = mvdev->dc;
int retry = 100, i;
int retry;

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

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

mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db);
return true;
}

static void mic_del_vq(struct virtqueue *vq, int n)
Expand Down Expand Up @@ -247,17 +248,17 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev,
/* First assign the vring's allocated in host memory */
vqconfig = mic_vq_config(mvdev->desc) + index;
memcpy_fromio(&config, vqconfig, sizeof(config));
_vr_size = vring_size(config.num, MIC_VIRTIO_RING_ALIGN);
_vr_size = vring_size(le16_to_cpu(config.num), MIC_VIRTIO_RING_ALIGN);
vr_size = PAGE_ALIGN(_vr_size + sizeof(struct _mic_vring_info));
va = mic_card_map(mvdev->mdev, config.address, vr_size);
va = mic_card_map(mvdev->mdev, le64_to_cpu(config.address), vr_size);
if (!va)
return ERR_PTR(-ENOMEM);
mvdev->vr[index] = va;
memset_io(va, 0x0, _vr_size);
vq = vring_new_virtqueue(index,
config.num, MIC_VIRTIO_RING_ALIGN, vdev,
false,
va, mic_notify, callback, name);
vq = vring_new_virtqueue(index, le16_to_cpu(config.num),
MIC_VIRTIO_RING_ALIGN, vdev, false,
(void __force *)va, mic_notify, callback,
name);
if (!vq) {
err = -ENOMEM;
goto unmap;
Expand All @@ -272,7 +273,8 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev,

/* Allocate and reassign used ring now */
mvdev->used_size[index] = PAGE_ALIGN(sizeof(__u16) * 3 +
sizeof(struct vring_used_elem) * config.num);
sizeof(struct vring_used_elem) *
le16_to_cpu(config.num));
used = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
get_order(mvdev->used_size[index]));
if (!used) {
Expand Down Expand Up @@ -309,7 +311,7 @@ static int mic_find_vqs(struct virtio_device *vdev, unsigned nvqs,
{
struct mic_vdev *mvdev = to_micvdev(vdev);
struct mic_device_ctrl __iomem *dc = mvdev->dc;
int i, err, retry = 100;
int i, err, retry;

/* We must have this many virtqueues. */
if (nvqs > ioread8(&mvdev->desc->num_vq))
Expand All @@ -331,7 +333,7 @@ static int mic_find_vqs(struct virtio_device *vdev, unsigned nvqs,
* rings have been re-assigned.
*/
mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db);
for (i = retry; i--;) {
for (retry = 100; retry--;) {
if (!ioread8(&dc->used_address_updated))
break;
msleep(100);
Expand Down Expand Up @@ -519,8 +521,8 @@ static void mic_scan_devices(struct mic_driver *mdrv, bool remove)
struct device *dev;
int ret;

for (i = mic_aligned_size(struct mic_bootparam);
i < MIC_DP_SIZE; i += mic_total_desc_size(d)) {
for (i = sizeof(struct mic_bootparam); i < MIC_DP_SIZE;
i += mic_total_desc_size(d)) {
d = mdrv->dp + i;
dc = (void __iomem *)d + mic_aligned_desc_size(d);
/*
Expand All @@ -539,7 +541,8 @@ static void mic_scan_devices(struct mic_driver *mdrv, bool remove)
continue;

/* device already exists */
dev = device_find_child(mdrv->dev, d, mic_match_desc);
dev = device_find_child(mdrv->dev, (void __force *)d,
mic_match_desc);
if (dev) {
if (remove)
iowrite8(MIC_VIRTIO_PARAM_DEV_REMOVE,
Expand Down
7 changes: 3 additions & 4 deletions drivers/misc/mic/card/mic_virtio.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

static inline unsigned mic_desc_size(struct mic_device_desc __iomem *desc)
{
return mic_aligned_size(*desc)
+ ioread8(&desc->num_vq) * mic_aligned_size(struct mic_vqconfig)
return sizeof(*desc)
+ ioread8(&desc->num_vq) * sizeof(struct mic_vqconfig)
+ ioread8(&desc->feature_len) * 2
+ ioread8(&desc->config_len);
}
Expand All @@ -67,8 +67,7 @@ mic_vq_configspace(struct mic_device_desc __iomem *desc)
}
static inline unsigned mic_total_desc_size(struct mic_device_desc __iomem *desc)
{
return mic_aligned_desc_size(desc) +
mic_aligned_size(struct mic_device_ctrl);
return mic_aligned_desc_size(desc) + sizeof(struct mic_device_ctrl);
}

int mic_devices_init(struct mic_driver *mdrv);
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mic/host/mic_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void mic_bootparam_init(struct mic_device *mdev)
{
struct mic_bootparam *bootparam = mdev->dp;

bootparam->magic = MIC_MAGIC;
bootparam->magic = cpu_to_le32(MIC_MAGIC);
bootparam->c2h_shutdown_db = mdev->shutdown_db;
bootparam->h2c_shutdown_db = -1;
bootparam->h2c_config_db = -1;
Expand Down
Loading

0 comments on commit f64001e

Please sign in to comment.