Displaying 17 results from an estimated 17 matches for "sysfs_streq".
2017 Jun 09
3
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...rs/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev, struct device_attribute *attr,
int i;
BUG_ON(!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_CONFIG_WCE));
- for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
- if (sysfs_streq(buf, virtblk_cache_types[i]))
- break;
-
+ i = sysfs_match_string(virtblk_cache_types, buf);
if (i < 0)
- return -EINVAL;
+ return i;
virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce), i);
virtblk_update_cache_mode(vdev);
--
2.11.0
2017 Jun 09
3
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...rs/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev, struct device_attribute *attr,
int i;
BUG_ON(!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_CONFIG_WCE));
- for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
- if (sysfs_streq(buf, virtblk_cache_types[i]))
- break;
-
+ i = sysfs_match_string(virtblk_cache_types, buf);
if (i < 0)
- return -EINVAL;
+ return i;
virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce), i);
virtblk_update_cache_mode(vdev);
--
2.11.0
2012 Jul 04
1
[PATCH] virtio-blk: allow toggling host cache between writeback and writethrough
...gt; + struct virtio_blk *vblk = disk->private_data;
> + struct virtio_device *vdev = vblk->vdev;
> + int i;
> + u8 writeback;
> +
> + BUG_ON(!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_CONFIG_WCE));
> + for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
> + if (sysfs_streq(buf, virtblk_cache_types[i]))
> + break;
> +
> + if (i < 0)
> + return -EINVAL;
> +
> + writeback = i;
> + vdev->config->set(vdev,
> + offsetof(struct virtio_blk_config, wce),
> + &writeback, sizeof(writeback));
> +
> + virtblk_update_cache_m...
2012 Jul 04
1
[PATCH] virtio-blk: allow toggling host cache between writeback and writethrough
...gt; + struct virtio_blk *vblk = disk->private_data;
> + struct virtio_device *vdev = vblk->vdev;
> + int i;
> + u8 writeback;
> +
> + BUG_ON(!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_CONFIG_WCE));
> + for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
> + if (sysfs_streq(buf, virtblk_cache_types[i]))
> + break;
> +
> + if (i < 0)
> + return -EINVAL;
> +
> + writeback = i;
> + vdev->config->set(vdev,
> + offsetof(struct virtio_blk_config, wce),
> + &writeback, sizeof(writeback));
> +
> + virtblk_update_cache_m...
2017 Jul 03
0
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...k/virtio_blk.c
> @@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev,
> struct device_attribute *attr,
> ? int i;
> ?
> ? BUG_ON(!virtio_has_feature(vblk->vdev,
> VIRTIO_BLK_F_CONFIG_WCE));
> - for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
> - if (sysfs_streq(buf, virtblk_cache_types[i]))
> - break;
> -
> + i = sysfs_match_string(virtblk_cache_types, buf);
> ? if (i < 0)
> - return -EINVAL;
> + return i;
> ?
> ? virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce),
> i);
> ? virtblk_update_cache_mode(vdev);...
2017 Jul 03
2
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...,9 @@ virtblk_cache_type_store(struct device *dev,
> > struct device_attribute *attr,
> > ? int i;
> > ?
> > ? BUG_ON(!virtio_has_feature(vblk->vdev,
> > VIRTIO_BLK_F_CONFIG_WCE));
> > - for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
> > - if (sysfs_streq(buf, virtblk_cache_types[i]))
> > - break;
> > -
> > + i = sysfs_match_string(virtblk_cache_types, buf);
> > ? if (i < 0)
> > - return -EINVAL;
> > + return i;
> > ?
> > ? virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce),
> >...
2017 Jul 03
2
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...,9 @@ virtblk_cache_type_store(struct device *dev,
> > struct device_attribute *attr,
> > ? int i;
> > ?
> > ? BUG_ON(!virtio_has_feature(vblk->vdev,
> > VIRTIO_BLK_F_CONFIG_WCE));
> > - for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
> > - if (sysfs_streq(buf, virtblk_cache_types[i]))
> > - break;
> > -
> > + i = sysfs_match_string(virtblk_cache_types, buf);
> > ? if (i < 0)
> > - return -EINVAL;
> > + return i;
> > ?
> > ? virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce),
> >...
2013 Sep 05
0
[PATCH RESEND v3 3/7] Intel MIC Host Driver, card OS state management.
...SIZE, "%s\n",
+ mic_state_string[mdev->state]);
+}
+
+static ssize_t
+mic_store_state(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ int rc = 0;
+ struct mic_device *mdev = dev_get_drvdata(dev->parent);
+ if (!mdev)
+ return -EINVAL;
+ if (sysfs_streq(buf, "boot")) {
+ rc = mic_start(mdev, buf);
+ if (rc) {
+ dev_err(mdev->sdev->parent,
+ "mic_boot failed rc %d\n", rc);
+ count = rc;
+ }
+ goto done;
+ }
+
+ if (sysfs_streq(buf, "reset")) {
+ schedule_work(&mdev->reset_trigger_work);
+ goto...
2013 Jul 25
0
[PATCH 1/5] Intel MIC Host Driver for X100 family.
...rvdata(dev->parent);
+ if (!mdev)
+ return -EINVAL;
+ if (!strncmp(buf, "boot", strlen("boot"))) {
+ rc = mic_start(mdev, buf);
+ if (rc) {
+ dev_err(&mdev->pdev->dev,
+ "mic_boot failed rc %d\n", rc);
+ count = rc;
+ }
+ goto done;
+ }
+
+ if (sysfs_streq(buf, "reset")) {
+ schedule_work(&mdev->reset_trigger_work);
+ goto done;
+ }
+
+ if (sysfs_streq(buf, "shutdown")) {
+ mic_shutdown(mdev);
+ goto done;
+ }
+
+ count = -EINVAL;
+done:
+ return count;
+}
+static DEVICE_ATTR(state, S_IRUGO|S_IWUSR, show_micstate, set_m...
2013 Aug 21
10
[PATCH v3 0/7] Enable Drivers for Intel MIC X100 Coprocessors.
ChangeLog:
=========
v2 => v3:
a) Patch 1 data structure cleanups, header file include cleanups,
IDA interface reuse and switching to device_create_with_groups(..)
as per feedback from Greg Kroah-Hartman.
b) Patch 7 signal documentation, sleep workaround removal and sysfs
access API cleanups as per feedback from Michael S. Tsirkin.
v1 => v2: @ http://lwn.net/Articles/563131/
a)
2013 Aug 21
10
[PATCH v3 0/7] Enable Drivers for Intel MIC X100 Coprocessors.
ChangeLog:
=========
v2 => v3:
a) Patch 1 data structure cleanups, header file include cleanups,
IDA interface reuse and switching to device_create_with_groups(..)
as per feedback from Greg Kroah-Hartman.
b) Patch 7 signal documentation, sleep workaround removal and sysfs
access API cleanups as per feedback from Michael S. Tsirkin.
v1 => v2: @ http://lwn.net/Articles/563131/
a)
2013 Sep 05
16
[PATCH RESEND v3 0/7] Enable Drivers for Intel MIC X100 Coprocessors.
ChangeLog:
=========
v2 => v3:
a) Patch 1 data structure cleanups, header file include cleanups,
IDA interface reuse and switching to device_create_with_groups(..)
as per feedback from Greg Kroah-Hartman.
b) Patch 7 signal documentation, sleep workaround removal and sysfs
access API cleanups as per feedback from Michael S. Tsirkin.
v1 => v2: @ http://lwn.net/Articles/563131/
a)
2013 Sep 05
16
[PATCH RESEND v3 0/7] Enable Drivers for Intel MIC X100 Coprocessors.
ChangeLog:
=========
v2 => v3:
a) Patch 1 data structure cleanups, header file include cleanups,
IDA interface reuse and switching to device_create_with_groups(..)
as per feedback from Greg Kroah-Hartman.
b) Patch 7 signal documentation, sleep workaround removal and sysfs
access API cleanups as per feedback from Michael S. Tsirkin.
v1 => v2: @ http://lwn.net/Articles/563131/
a)
2013 Jul 25
16
[PATCH 0/5] Enable Drivers for Intel MIC X100 Coprocessors.
An Intel MIC X100 device is a PCIe form factor add-in coprocessor
card based on the Intel Many Integrated Core (MIC) architecture
that runs a Linux OS. It is a PCIe endpoint in a platform and therefore
implements the three required standard address spaces i.e. configuration,
memory and I/O. The host OS loads a device driver as is typical for
PCIe devices. The card itself runs a bootstrap after
2013 Jul 25
16
[PATCH 0/5] Enable Drivers for Intel MIC X100 Coprocessors.
An Intel MIC X100 device is a PCIe form factor add-in coprocessor
card based on the Intel Many Integrated Core (MIC) architecture
that runs a Linux OS. It is a PCIe endpoint in a platform and therefore
implements the three required standard address spaces i.e. configuration,
memory and I/O. The host OS loads a device driver as is typical for
PCIe devices. The card itself runs a bootstrap after
2013 Aug 08
10
[PATCH v2 0/7] Enable Drivers for Intel MIC X100 Coprocessors.
ChangeLog:
=========
v1 => v2:
a) License wording cleanup, sysfs ABI documentation, patch 1 refactoring
into 3 smaller patches and function renames, as per feedback from
Greg Kroah-Hartman.
b) Use VRINGH infrastructure for accessing virtio rings from the host
in patch 5, as per feedback from Michael S. Tsirkin.
v1: Initial post @ https://lkml.org/lkml/2013/7/24/810
Description:
2013 Aug 08
10
[PATCH v2 0/7] Enable Drivers for Intel MIC X100 Coprocessors.
ChangeLog:
=========
v1 => v2:
a) License wording cleanup, sysfs ABI documentation, patch 1 refactoring
into 3 smaller patches and function renames, as per feedback from
Greg Kroah-Hartman.
b) Use VRINGH infrastructure for accessing virtio rings from the host
in patch 5, as per feedback from Michael S. Tsirkin.
v1: Initial post @ https://lkml.org/lkml/2013/7/24/810
Description: