* [PATCH 2/2] PCI: NVMe device specific reset quirk
From: Alex Williamson @ 2018-07-23 22:24 UTC (permalink / raw)
To: linux-pci; +Cc: linux-kernel, linux-nvme
In-Reply-To: <20180723221533.4371.90064.stgit@gimli.home>
Take advantage of NVMe devices using a standard interface to quiesce
the controller prior to reset, including device specific delays before
and after that reset. This resolves several NVMe device assignment
scenarios with two different vendors. The Intel DC P3700 controller
has been shown to only work as a VM boot device on the initial VM
startup, failing after reset or reboot, and also fails to initialize
after hot-plug into a VM. Adding a delay after FLR resolves these
cases. The Samsung SM961/PM961 (960 EVO) sometimes fails to return
from FLR with the PCI config space reading back as -1. A reproducible
instance of this behavior is resolved by clearing the enable bit in
the configuration register and waiting for the ready status to clear
(disabling the NVMe controller) prior to FLR.
As all NVMe devices make use of this standard interface and the NVMe
specification also requires PCIe FLR support, we can apply this quirk
to all devices with matching class code.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
drivers/pci/quirks.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 112 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index e72c8742aafa..83853562f220 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -28,6 +28,7 @@
#include <linux/platform_data/x86/apple.h>
#include <linux/pm_runtime.h>
#include <linux/switchtec.h>
+#include <linux/nvme.h>
#include <asm/dma.h> /* isa_dma_bridge_buggy */
#include "pci.h"
@@ -3669,6 +3670,116 @@ static int reset_chelsio_generic_dev(struct pci_dev *dev, int probe)
#define PCI_DEVICE_ID_INTEL_IVB_M_VGA 0x0156
#define PCI_DEVICE_ID_INTEL_IVB_M2_VGA 0x0166
+/* NVMe controller needs delay before testing ready status */
+#define NVME_QUIRK_CHK_RDY_DELAY (1 << 0)
+/* NVMe controller needs post-FLR delay */
+#define NVME_QUIRK_POST_FLR_DELAY (1 << 1)
+
+static const struct pci_device_id nvme_reset_tbl[] = {
+ { PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x1c58, 0x0023), /* WDC SN200 adapter */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x1c5f, 0x0540), /* Memblaze Pblaze4 adapter */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x144d, 0xa821), /* Samsung PM1725 */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x144d, 0xa822), /* Samsung PM1725a */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0953), /* Intel DC P3700 */
+ .driver_data = NVME_QUIRK_POST_FLR_DELAY, },
+ { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
+ { 0 }
+};
+
+/*
+ * The NVMe specification requires that controllers support PCIe FLR, but
+ * but some Samsung SM961/PM961 controllers fail to recover after FLR (-1
+ * config space) unless the device is quiesced prior to FLR. Do this for
+ * all NVMe devices by disabling the controller before reset. Some Intel
+ * controllers also require an additional post-FLR delay or else attempts
+ * to re-enable will timeout, do that here as well with heuristically
+ * determined delay value. Also maintain the delay between disabling and
+ * checking ready status as used by the native NVMe driver.
+ */
+static int reset_nvme(struct pci_dev *dev, int probe)
+{
+ const struct pci_device_id *id;
+ void __iomem *bar;
+ u16 cmd;
+ u32 cfg;
+
+ id = pci_match_id(nvme_reset_tbl, dev);
+ if (!id || !pcie_has_flr(dev) || !pci_resource_start(dev, 0))
+ return -ENOTTY;
+
+ if (probe)
+ return 0;
+
+ bar = pci_iomap(dev, 0, NVME_REG_CC + sizeof(cfg));
+ if (!bar)
+ return -ENOTTY;
+
+ pci_read_config_word(dev, PCI_COMMAND, &cmd);
+ pci_write_config_word(dev, PCI_COMMAND, cmd | PCI_COMMAND_MEMORY);
+
+ cfg = readl(bar + NVME_REG_CC);
+
+ /* Disable controller if enabled */
+ if (cfg & NVME_CC_ENABLE) {
+ u64 cap = readq(bar + NVME_REG_CAP);
+ unsigned long timeout;
+
+ /*
+ * Per nvme_disable_ctrl() skip shutdown notification as it
+ * could complete commands to the admin queue. We only intend
+ * to quiesce the device before reset.
+ */
+ cfg &= ~(NVME_CC_SHN_MASK | NVME_CC_ENABLE);
+
+ writel(cfg, bar + NVME_REG_CC);
+
+ /* A heuristic value, matches NVME_QUIRK_DELAY_AMOUNT */
+ if (id->driver_data & NVME_QUIRK_CHK_RDY_DELAY)
+ msleep(2300);
+
+ /* Cap register provides max timeout in 500ms increments */
+ timeout = ((NVME_CAP_TIMEOUT(cap) + 1) * HZ / 2) + jiffies;
+
+ for (;;) {
+ u32 status = readl(bar + NVME_REG_CSTS);
+
+ /* Ready status becomes zero on disable complete */
+ if (!(status & NVME_CSTS_RDY))
+ break;
+
+ msleep(100);
+
+ if (time_after(jiffies, timeout)) {
+ pci_warn(dev, "Timeout waiting for NVMe ready status to clear after disable\n");
+ break;
+ }
+ }
+ }
+
+ pci_iounmap(dev, bar);
+
+ /*
+ * We could use the optional NVM Subsystem Reset here, hardware
+ * supporting this is simply unavailable at the time of this code
+ * to validate in comparison to PCIe FLR. NVMe spec dictates that
+ * NVMe devices shall implement PCIe FLR.
+ */
+ pcie_flr(dev);
+
+ if (id->driver_data & NVME_QUIRK_POST_FLR_DELAY)
+ msleep(250); /* Heuristic based on Intel DC P3700 */
+
+ return 0;
+}
+
static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF,
reset_intel_82599_sfp_virtfn },
@@ -3678,6 +3789,7 @@ static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
reset_ivb_igd },
{ PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID,
reset_chelsio_generic_dev },
+ { PCI_ANY_ID, PCI_ANY_ID, reset_nvme },
{ 0 }
};
^ permalink raw reply related
* [PATCH 2/2] PCI: NVMe device specific reset quirk
From: Alex Williamson @ 2018-07-23 22:24 UTC (permalink / raw)
To: linux-pci; +Cc: linux-kernel, linux-nvme
In-Reply-To: <20180723221533.4371.90064.stgit@gimli.home>
Take advantage of NVMe devices using a standard interface to quiesce
the controller prior to reset, including device specific delays before
and after that reset. This resolves several NVMe device assignment
scenarios with two different vendors. The Intel DC P3700 controller
has been shown to only work as a VM boot device on the initial VM
startup, failing after reset or reboot, and also fails to initialize
after hot-plug into a VM. Adding a delay after FLR resolves these
cases. The Samsung SM961/PM961 (960 EVO) sometimes fails to return
from FLR with the PCI config space reading back as -1. A reproducible
instance of this behavior is resolved by clearing the enable bit in
the configuration register and waiting for the ready status to clear
(disabling the NVMe controller) prior to FLR.
As all NVMe devices make use of this standard interface and the NVMe
specification also requires PCIe FLR support, we can apply this quirk
to all devices with matching class code.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
drivers/pci/quirks.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 112 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index e72c8742aafa..83853562f220 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -28,6 +28,7 @@
#include <linux/platform_data/x86/apple.h>
#include <linux/pm_runtime.h>
#include <linux/switchtec.h>
+#include <linux/nvme.h>
#include <asm/dma.h> /* isa_dma_bridge_buggy */
#include "pci.h"
@@ -3669,6 +3670,116 @@ static int reset_chelsio_generic_dev(struct pci_dev *dev, int probe)
#define PCI_DEVICE_ID_INTEL_IVB_M_VGA 0x0156
#define PCI_DEVICE_ID_INTEL_IVB_M2_VGA 0x0166
+/* NVMe controller needs delay before testing ready status */
+#define NVME_QUIRK_CHK_RDY_DELAY (1 << 0)
+/* NVMe controller needs post-FLR delay */
+#define NVME_QUIRK_POST_FLR_DELAY (1 << 1)
+
+static const struct pci_device_id nvme_reset_tbl[] = {
+ { PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x1c58, 0x0023), /* WDC SN200 adapter */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x1c5f, 0x0540), /* Memblaze Pblaze4 adapter */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x144d, 0xa821), /* Samsung PM1725 */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x144d, 0xa822), /* Samsung PM1725a */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0953), /* Intel DC P3700 */
+ .driver_data = NVME_QUIRK_POST_FLR_DELAY, },
+ { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
+ { 0 }
+};
+
+/*
+ * The NVMe specification requires that controllers support PCIe FLR, but
+ * but some Samsung SM961/PM961 controllers fail to recover after FLR (-1
+ * config space) unless the device is quiesced prior to FLR. Do this for
+ * all NVMe devices by disabling the controller before reset. Some Intel
+ * controllers also require an additional post-FLR delay or else attempts
+ * to re-enable will timeout, do that here as well with heuristically
+ * determined delay value. Also maintain the delay between disabling and
+ * checking ready status as used by the native NVMe driver.
+ */
+static int reset_nvme(struct pci_dev *dev, int probe)
+{
+ const struct pci_device_id *id;
+ void __iomem *bar;
+ u16 cmd;
+ u32 cfg;
+
+ id = pci_match_id(nvme_reset_tbl, dev);
+ if (!id || !pcie_has_flr(dev) || !pci_resource_start(dev, 0))
+ return -ENOTTY;
+
+ if (probe)
+ return 0;
+
+ bar = pci_iomap(dev, 0, NVME_REG_CC + sizeof(cfg));
+ if (!bar)
+ return -ENOTTY;
+
+ pci_read_config_word(dev, PCI_COMMAND, &cmd);
+ pci_write_config_word(dev, PCI_COMMAND, cmd | PCI_COMMAND_MEMORY);
+
+ cfg = readl(bar + NVME_REG_CC);
+
+ /* Disable controller if enabled */
+ if (cfg & NVME_CC_ENABLE) {
+ u64 cap = readq(bar + NVME_REG_CAP);
+ unsigned long timeout;
+
+ /*
+ * Per nvme_disable_ctrl() skip shutdown notification as it
+ * could complete commands to the admin queue. We only intend
+ * to quiesce the device before reset.
+ */
+ cfg &= ~(NVME_CC_SHN_MASK | NVME_CC_ENABLE);
+
+ writel(cfg, bar + NVME_REG_CC);
+
+ /* A heuristic value, matches NVME_QUIRK_DELAY_AMOUNT */
+ if (id->driver_data & NVME_QUIRK_CHK_RDY_DELAY)
+ msleep(2300);
+
+ /* Cap register provides max timeout in 500ms increments */
+ timeout = ((NVME_CAP_TIMEOUT(cap) + 1) * HZ / 2) + jiffies;
+
+ for (;;) {
+ u32 status = readl(bar + NVME_REG_CSTS);
+
+ /* Ready status becomes zero on disable complete */
+ if (!(status & NVME_CSTS_RDY))
+ break;
+
+ msleep(100);
+
+ if (time_after(jiffies, timeout)) {
+ pci_warn(dev, "Timeout waiting for NVMe ready status to clear after disable\n");
+ break;
+ }
+ }
+ }
+
+ pci_iounmap(dev, bar);
+
+ /*
+ * We could use the optional NVM Subsystem Reset here, hardware
+ * supporting this is simply unavailable at the time of this code
+ * to validate in comparison to PCIe FLR. NVMe spec dictates that
+ * NVMe devices shall implement PCIe FLR.
+ */
+ pcie_flr(dev);
+
+ if (id->driver_data & NVME_QUIRK_POST_FLR_DELAY)
+ msleep(250); /* Heuristic based on Intel DC P3700 */
+
+ return 0;
+}
+
static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF,
reset_intel_82599_sfp_virtfn },
@@ -3678,6 +3789,7 @@ static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
reset_ivb_igd },
{ PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID,
reset_chelsio_generic_dev },
+ { PCI_ANY_ID, PCI_ANY_ID, reset_nvme },
{ 0 }
};
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related
* [PATCH 2/2] PCI: NVMe device specific reset quirk
From: Alex Williamson @ 2018-07-23 22:24 UTC (permalink / raw)
In-Reply-To: <20180723221533.4371.90064.stgit@gimli.home>
Take advantage of NVMe devices using a standard interface to quiesce
the controller prior to reset, including device specific delays before
and after that reset. This resolves several NVMe device assignment
scenarios with two different vendors. The Intel DC P3700 controller
has been shown to only work as a VM boot device on the initial VM
startup, failing after reset or reboot, and also fails to initialize
after hot-plug into a VM. Adding a delay after FLR resolves these
cases. The Samsung SM961/PM961 (960 EVO) sometimes fails to return
from FLR with the PCI config space reading back as -1. A reproducible
instance of this behavior is resolved by clearing the enable bit in
the configuration register and waiting for the ready status to clear
(disabling the NVMe controller) prior to FLR.
As all NVMe devices make use of this standard interface and the NVMe
specification also requires PCIe FLR support, we can apply this quirk
to all devices with matching class code.
Signed-off-by: Alex Williamson <alex.williamson at redhat.com>
---
drivers/pci/quirks.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 112 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index e72c8742aafa..83853562f220 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -28,6 +28,7 @@
#include <linux/platform_data/x86/apple.h>
#include <linux/pm_runtime.h>
#include <linux/switchtec.h>
+#include <linux/nvme.h>
#include <asm/dma.h> /* isa_dma_bridge_buggy */
#include "pci.h"
@@ -3669,6 +3670,116 @@ static int reset_chelsio_generic_dev(struct pci_dev *dev, int probe)
#define PCI_DEVICE_ID_INTEL_IVB_M_VGA 0x0156
#define PCI_DEVICE_ID_INTEL_IVB_M2_VGA 0x0166
+/* NVMe controller needs delay before testing ready status */
+#define NVME_QUIRK_CHK_RDY_DELAY (1 << 0)
+/* NVMe controller needs post-FLR delay */
+#define NVME_QUIRK_POST_FLR_DELAY (1 << 1)
+
+static const struct pci_device_id nvme_reset_tbl[] = {
+ { PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x1c58, 0x0023), /* WDC SN200 adapter */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x1c5f, 0x0540), /* Memblaze Pblaze4 adapter */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x144d, 0xa821), /* Samsung PM1725 */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(0x144d, 0xa822), /* Samsung PM1725a */
+ .driver_data = NVME_QUIRK_CHK_RDY_DELAY, },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0953), /* Intel DC P3700 */
+ .driver_data = NVME_QUIRK_POST_FLR_DELAY, },
+ { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
+ { 0 }
+};
+
+/*
+ * The NVMe specification requires that controllers support PCIe FLR, but
+ * but some Samsung SM961/PM961 controllers fail to recover after FLR (-1
+ * config space) unless the device is quiesced prior to FLR. Do this for
+ * all NVMe devices by disabling the controller before reset. Some Intel
+ * controllers also require an additional post-FLR delay or else attempts
+ * to re-enable will timeout, do that here as well with heuristically
+ * determined delay value. Also maintain the delay between disabling and
+ * checking ready status as used by the native NVMe driver.
+ */
+static int reset_nvme(struct pci_dev *dev, int probe)
+{
+ const struct pci_device_id *id;
+ void __iomem *bar;
+ u16 cmd;
+ u32 cfg;
+
+ id = pci_match_id(nvme_reset_tbl, dev);
+ if (!id || !pcie_has_flr(dev) || !pci_resource_start(dev, 0))
+ return -ENOTTY;
+
+ if (probe)
+ return 0;
+
+ bar = pci_iomap(dev, 0, NVME_REG_CC + sizeof(cfg));
+ if (!bar)
+ return -ENOTTY;
+
+ pci_read_config_word(dev, PCI_COMMAND, &cmd);
+ pci_write_config_word(dev, PCI_COMMAND, cmd | PCI_COMMAND_MEMORY);
+
+ cfg = readl(bar + NVME_REG_CC);
+
+ /* Disable controller if enabled */
+ if (cfg & NVME_CC_ENABLE) {
+ u64 cap = readq(bar + NVME_REG_CAP);
+ unsigned long timeout;
+
+ /*
+ * Per nvme_disable_ctrl() skip shutdown notification as it
+ * could complete commands to the admin queue. We only intend
+ * to quiesce the device before reset.
+ */
+ cfg &= ~(NVME_CC_SHN_MASK | NVME_CC_ENABLE);
+
+ writel(cfg, bar + NVME_REG_CC);
+
+ /* A heuristic value, matches NVME_QUIRK_DELAY_AMOUNT */
+ if (id->driver_data & NVME_QUIRK_CHK_RDY_DELAY)
+ msleep(2300);
+
+ /* Cap register provides max timeout in 500ms increments */
+ timeout = ((NVME_CAP_TIMEOUT(cap) + 1) * HZ / 2) + jiffies;
+
+ for (;;) {
+ u32 status = readl(bar + NVME_REG_CSTS);
+
+ /* Ready status becomes zero on disable complete */
+ if (!(status & NVME_CSTS_RDY))
+ break;
+
+ msleep(100);
+
+ if (time_after(jiffies, timeout)) {
+ pci_warn(dev, "Timeout waiting for NVMe ready status to clear after disable\n");
+ break;
+ }
+ }
+ }
+
+ pci_iounmap(dev, bar);
+
+ /*
+ * We could use the optional NVM Subsystem Reset here, hardware
+ * supporting this is simply unavailable at the time of this code
+ * to validate in comparison to PCIe FLR. NVMe spec dictates that
+ * NVMe devices shall implement PCIe FLR.
+ */
+ pcie_flr(dev);
+
+ if (id->driver_data & NVME_QUIRK_POST_FLR_DELAY)
+ msleep(250); /* Heuristic based on Intel DC P3700 */
+
+ return 0;
+}
+
static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF,
reset_intel_82599_sfp_virtfn },
@@ -3678,6 +3789,7 @@ static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
reset_ivb_igd },
{ PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID,
reset_chelsio_generic_dev },
+ { PCI_ANY_ID, PCI_ANY_ID, reset_nvme },
{ 0 }
};
^ permalink raw reply related
* [PATCH 1/2] PCI: Export pcie_has_flr()
From: Alex Williamson @ 2018-07-23 22:24 UTC (permalink / raw)
To: linux-pci; +Cc: linux-kernel, linux-nvme
In-Reply-To: <20180723221533.4371.90064.stgit@gimli.home>
pcie_flr() suggests pcie_has_flr() to ensure that PCIe FLR support is
present prior to calling. pcie_flr() is exported while pcie_has_flr()
is not. Resolve this.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
drivers/pci/pci.c | 3 ++-
include/linux/pci.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 2bec76c9d9a7..52fe2d72a99c 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4071,7 +4071,7 @@ static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
* Returns true if the device advertises support for PCIe function level
* resets.
*/
-static bool pcie_has_flr(struct pci_dev *dev)
+bool pcie_has_flr(struct pci_dev *dev)
{
u32 cap;
@@ -4081,6 +4081,7 @@ static bool pcie_has_flr(struct pci_dev *dev)
pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &cap);
return cap & PCI_EXP_DEVCAP_FLR;
}
+EXPORT_SYMBOL_GPL(pcie_has_flr);
/**
* pcie_flr - initiate a PCIe function level reset
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 04c7ea6ed67b..bbe030d7814f 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1092,6 +1092,7 @@ u32 pcie_bandwidth_available(struct pci_dev *dev, struct pci_dev **limiting_dev,
enum pci_bus_speed *speed,
enum pcie_link_width *width);
void pcie_print_link_status(struct pci_dev *dev);
+bool pcie_has_flr(struct pci_dev *dev);
int pcie_flr(struct pci_dev *dev);
int __pci_reset_function_locked(struct pci_dev *dev);
int pci_reset_function(struct pci_dev *dev);
^ permalink raw reply related
* [PATCH 1/2] PCI: Export pcie_has_flr()
From: Alex Williamson @ 2018-07-23 22:24 UTC (permalink / raw)
To: linux-pci; +Cc: linux-kernel, linux-nvme
In-Reply-To: <20180723221533.4371.90064.stgit@gimli.home>
pcie_flr() suggests pcie_has_flr() to ensure that PCIe FLR support is
present prior to calling. pcie_flr() is exported while pcie_has_flr()
is not. Resolve this.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
drivers/pci/pci.c | 3 ++-
include/linux/pci.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 2bec76c9d9a7..52fe2d72a99c 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4071,7 +4071,7 @@ static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
* Returns true if the device advertises support for PCIe function level
* resets.
*/
-static bool pcie_has_flr(struct pci_dev *dev)
+bool pcie_has_flr(struct pci_dev *dev)
{
u32 cap;
@@ -4081,6 +4081,7 @@ static bool pcie_has_flr(struct pci_dev *dev)
pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &cap);
return cap & PCI_EXP_DEVCAP_FLR;
}
+EXPORT_SYMBOL_GPL(pcie_has_flr);
/**
* pcie_flr - initiate a PCIe function level reset
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 04c7ea6ed67b..bbe030d7814f 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1092,6 +1092,7 @@ u32 pcie_bandwidth_available(struct pci_dev *dev, struct pci_dev **limiting_dev,
enum pci_bus_speed *speed,
enum pcie_link_width *width);
void pcie_print_link_status(struct pci_dev *dev);
+bool pcie_has_flr(struct pci_dev *dev);
int pcie_flr(struct pci_dev *dev);
int __pci_reset_function_locked(struct pci_dev *dev);
int pci_reset_function(struct pci_dev *dev);
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related
* [PATCH 1/2] PCI: Export pcie_has_flr()
From: Alex Williamson @ 2018-07-23 22:24 UTC (permalink / raw)
In-Reply-To: <20180723221533.4371.90064.stgit@gimli.home>
pcie_flr() suggests pcie_has_flr() to ensure that PCIe FLR support is
present prior to calling. pcie_flr() is exported while pcie_has_flr()
is not. Resolve this.
Signed-off-by: Alex Williamson <alex.williamson at redhat.com>
---
drivers/pci/pci.c | 3 ++-
include/linux/pci.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 2bec76c9d9a7..52fe2d72a99c 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4071,7 +4071,7 @@ static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
* Returns true if the device advertises support for PCIe function level
* resets.
*/
-static bool pcie_has_flr(struct pci_dev *dev)
+bool pcie_has_flr(struct pci_dev *dev)
{
u32 cap;
@@ -4081,6 +4081,7 @@ static bool pcie_has_flr(struct pci_dev *dev)
pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &cap);
return cap & PCI_EXP_DEVCAP_FLR;
}
+EXPORT_SYMBOL_GPL(pcie_has_flr);
/**
* pcie_flr - initiate a PCIe function level reset
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 04c7ea6ed67b..bbe030d7814f 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1092,6 +1092,7 @@ u32 pcie_bandwidth_available(struct pci_dev *dev, struct pci_dev **limiting_dev,
enum pci_bus_speed *speed,
enum pcie_link_width *width);
void pcie_print_link_status(struct pci_dev *dev);
+bool pcie_has_flr(struct pci_dev *dev);
int pcie_flr(struct pci_dev *dev);
int __pci_reset_function_locked(struct pci_dev *dev);
int pci_reset_function(struct pci_dev *dev);
^ permalink raw reply related
* [PATCH 0/2] PCI: NVMe reset quirk
From: Alex Williamson @ 2018-07-23 22:24 UTC (permalink / raw)
As discussed in the 2nd patch, at least one NVMe controller sometimes
doesn't like being reset while enabled and another will timeout during
a subsequent re-enable if it happens too quickly after reset.
Introduce a device specific reset quirk for all NVMe class devices so
that we can try to get reliable behavior from them for device
assignment and any other users of the PCI subsystem reset interface.
Patches against current PCI next branch. Thanks,
Alex
---
Alex Williamson (2):
PCI: Export pcie_has_flr()
PCI: NVMe device specific reset quirk
drivers/pci/pci.c | 3 +
drivers/pci/quirks.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++
include/linux/pci.h | 1
3 files changed, 115 insertions(+), 1 deletion(-)
^ permalink raw reply
* Re: [PATCH] mtd: spi-nor: clear Extended Address Reg on switch to 3-byte addressing.
From: NeilBrown @ 2018-07-23 22:23 UTC (permalink / raw)
To: Brian Norris
Cc: Marek Vasut, Cyrille Pitchen, David Woodhouse, Boris Brezillon,
Richard Weinberger, linux-mtd, Linux Kernel, Hou Zhiqiang
In-Reply-To: <CAN8TOE-+XpeQ0eLEW3YdAGGtuw5reeuJRZvnMb+QquJycJWLQA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2337 bytes --]
On Mon, Jul 23 2018, Brian Norris wrote:
> Hi Neil,
>
> On Mon, Jul 23, 2018 at 2:45 PM, NeilBrown <neil@brown.name> wrote:
>> On Mon, Jul 23 2018, Brian Norris wrote:
>>> On Mon, Apr 9, 2018 at 6:05 PM, NeilBrown <neil@brown.name> wrote:
>>>> On Mon, Apr 09 2018, Marek Vasut wrote:
>>>>> On 04/08/2018 11:56 PM, NeilBrown wrote:
>>>>>> were added to Linux. They appear to be designed to address a very
>>>>>> similar situation to mine. Unfortunately they aren't complete as the
>>>>>> code to disable 4-byte addressing doesn't follow documented requirements
>>>>>> (at least for winbond) and doesn't work as intended (at least in one
>>>>>> case - mine). This code should either be fixed (e.g. with my patch), or removed.
>>>
>>> I would (and already did) vote for removal. The shutdown() hook just
>>> papers over bugs and leads people to think that it is a good solution.
>>> There's a reason we rejected such patches repeatedly in the past. This
>>> one slipped through.
>>
>> Hi Brian,
>> thanks for your thoughts.
>> Could you just clarify what you see as the end-game.
>> Do you have an alternate approach which can provide reliability for the
>> various hardware which currently seems to need these patches?
>> Or do you propose that people with this hardware should suffer
>> a measurably lower level of reliability than they currently enjoy?
>
> I'd suggest following the original thread, which I resurrected:
>
> [PATCHv3 2/2] mtd: m25p80: restore the status of SPI flash when exiting
> https://lkml.org/lkml/2018/7/23/1207
> https://patchwork.ozlabs.org/patch/845022/
Thanks for the links.
>
> I suppose I could CC you on future replies...
No need (though I wouldn't object). Thanks for the heads-up!
>
> My current summary: I'd prefer the hack be much more narrowly applied,
> with a big warning, if we apply it at all. But if we don't merge
> something to narrow the use of the hack, then yes, I'd prefer a
> degraded experience for crappy products over today's status quo.
>
I'm strongly against degrading experience - partly because it could be
my experiences, partly because it seems to go against the pragmatic
basis of Linux - we build this thing because it is useful.
I don't object to highly focuses handling of specific "quirks" - that
seems to be an established pattern in Linux.
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply
* Re: [PATCH] drm/i915: Skip repeated calls to i915_gem_set_wedged()
From: Rodrigo Vivi @ 2018-07-23 22:23 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
In-Reply-To: <20180723145335.24579-1-chris@chris-wilson.co.uk>
On Mon, Jul 23, 2018 at 03:53:35PM +0100, Chris Wilson wrote:
> If we already wedged, i915_gem_set_wedged() becomes a complicated no-op.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=107343
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 8b52cb768a67..a4031fab57b0 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3312,8 +3312,8 @@ void i915_gem_set_wedged(struct drm_i915_private *i915)
> intel_engine_dump(engine, &p, "%s\n", engine->name);
> }
>
> - set_bit(I915_WEDGED, &i915->gpu_error.flags);
> - smp_mb__after_atomic();
> + if (test_and_set_bit(I915_WEDGED, &i915->gpu_error.flags))
> + goto out;
>
> /*
> * First, stop submission to hw, but do not yet complete requests by
> @@ -3372,6 +3372,7 @@ void i915_gem_set_wedged(struct drm_i915_private *i915)
> i915_gem_reset_finish_engine(engine);
> }
>
> +out:
> GEM_TRACE("end\n");
>
> wake_up_all(&i915->gpu_error.reset_queue);
> --
> 2.18.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH v7 08/12] mfd: intel-peci-client: Add PECI client MFD driver
From: Randy Dunlap @ 2018-07-23 22:21 UTC (permalink / raw)
To: Jae Hyun Yoo, Jean Delvare, Guenter Roeck, Rob Herring,
Mark Rutland, Lee Jones, Joel Stanley, Andrew Jeffery,
Jonathan Corbet, Greg Kroah-Hartman, Gustavo Pimentel,
Kishon Vijay Abraham I, Lorenzo Pieralisi, Darrick J . Wong,
Eric Sandeen, Arnd Bergmann, Wu Hao, Tomohiro Kusumi,
Bryant G . Ly, Frederic Barrat, David S . Miller,
Mauro Carvalho Chehab, Andrew Morton, Philippe Ombredanne,
Vinod Koul, Stephen Boyd, David Kershner, Uwe Kleine-Konig,
Sagar Dharia, Johan Hovold, Thomas Gleixner, Juergen Gross,
Cyrille Pitchen
Cc: linux-hwmon, devicetree, linux-kernel, linux-arm-kernel,
linux-aspeed, linux-doc, openbmc, James Feist, Jason M Biils,
Vernon Mauery
In-Reply-To: <20180723214751.1733-9-jae.hyun.yoo@linux.intel.com>
On 07/23/2018 02:47 PM, Jae Hyun Yoo wrote:
> This commit adds PECI client MFD driver.
>
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Andrew Jeffery <andrew@aj.id.au>
> Cc: James Feist <james.feist@linux.intel.com>
> Cc: Jason M Biils <jason.m.bills@linux.intel.com>
> Cc: Joel Stanley <joel@jms.id.au>
> Cc: Vernon Mauery <vernon.mauery@linux.intel.com>
> ---
> drivers/mfd/Kconfig | 14 ++
> drivers/mfd/Makefile | 1 +
> drivers/mfd/intel-peci-client.c | 182 ++++++++++++++++++++++++++
> include/linux/mfd/intel-peci-client.h | 81 ++++++++++++
> 4 files changed, 278 insertions(+)
> create mode 100644 drivers/mfd/intel-peci-client.c
> create mode 100644 include/linux/mfd/intel-peci-client.h
>
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index f3fa516011ec..e38b591479d4 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -595,6 +595,20 @@ config MFD_INTEL_MSIC
> Passage) chip. This chip embeds audio, battery, GPIO, etc.
> devices used in Intel Medfield platforms.
>
> +config MFD_INTEL_PECI_CLIENT
> + bool "Intel PECI client"
> + depends on (PECI || COMPILE_TEST)
> + select MFD_CORE
> + help
> + If you say yes to this option, support will be included for the
> + multi-funtional Intel PECI (Platform Environment Control Interface)
multi-functional
> + client. PECI is a one-wire bus interface that provides a communication
> + channel from PECI clients in Intel processors and chipset components
> + to external monitoring or control devices.
> +
> + Additional drivers must be enabled in order to use the functionality
> + of the device.
> +
> config MFD_IPAQ_MICRO
> bool "Atmel Micro ASIC (iPAQ h3100/h3600/h3700) Support"
> depends on SA1100_H3100 || SA1100_H3600
--
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [Qemu-devel] [PATCH for-3.0 7/7] iotests: 169: add cases for source vm resuming
From: John Snow @ 2018-07-23 22:22 UTC (permalink / raw)
To: qemu-devel, qemu-block
Cc: Juan Quintela, qemu-stable, Dr. David Alan Gilbert, John Snow,
Fam Zheng, Kevin Wolf, Stefan Hajnoczi, eblake, Max Reitz,
Vladimir Sementsov-Ogievskiy
In-Reply-To: <20180723222210.11077-1-jsnow@redhat.com>
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Test that we can resume source vm after [failed] migration, and bitmaps
are ok.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/169 | 59 +++++++++++++++++++++++++++++++++++++++++++++-
tests/qemu-iotests/169.out | 4 ++--
2 files changed, 60 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/169 b/tests/qemu-iotests/169
index 24027da8e1..9cd8853d3c 100755
--- a/tests/qemu-iotests/169
+++ b/tests/qemu-iotests/169
@@ -77,6 +77,57 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase):
self.assert_qmp(result, 'error/desc',
"Dirty bitmap 'bitmap0' not found");
+ def do_test_migration_resume_source(self, persistent, migrate_bitmaps):
+ granularity = 512
+
+ # regions = ((start, count), ...)
+ regions = ((0, 0x10000),
+ (0xf0000, 0x10000),
+ (0xa0201, 0x1000))
+
+ mig_caps = [{'capability': 'events', 'state': True}]
+ if migrate_bitmaps:
+ mig_caps.append({'capability': 'dirty-bitmaps', 'state': True})
+
+ result = self.vm_a.qmp('migrate-set-capabilities',
+ capabilities=mig_caps)
+ self.assert_qmp(result, 'return', {})
+
+ self.add_bitmap(self.vm_a, granularity, persistent)
+ for r in regions:
+ self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % r)
+ sha256 = self.get_bitmap_hash(self.vm_a)
+
+ result = self.vm_a.qmp('migrate', uri=mig_cmd)
+ while True:
+ event = self.vm_a.event_wait('MIGRATION')
+ if event['data']['status'] == 'completed':
+ break
+
+ # test that bitmap is still here
+ self.check_bitmap(self.vm_a, False if persistent else sha256)
+
+ self.vm_a.qmp('cont')
+
+ # test that bitmap is still here after invalidation
+ self.check_bitmap(self.vm_a, sha256)
+
+ # shutdown and check that invalidation didn't fail
+ self.vm_a.shutdown()
+
+ # catch 'Could not reopen qcow2 layer: Bitmap already exists'
+ # possible error
+ log = self.vm_a.get_log()
+ log = re.sub(r'^\[I \d+\.\d+\] OPENED\n', '', log)
+ log = re.sub(r'^(wrote .* bytes at offset .*\n.*KiB.*ops.*sec.*\n){3}',
+ '', log)
+ log = re.sub(r'\[I \+\d+\.\d+\] CLOSED\n?$', '', log)
+ self.assertEqual(log, '')
+
+ # test that bitmap is still persistent
+ self.vm_a.launch()
+ self.check_bitmap(self.vm_a, sha256 if persistent else False)
+
def do_test_migration(self, persistent, migrate_bitmaps, online,
shared_storage):
granularity = 512
@@ -157,7 +208,7 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase):
def inject_test_case(klass, name, method, *args, **kwargs):
mc = operator.methodcaller(method, *args, **kwargs)
- setattr(klass, 'test_' + name, new.instancemethod(mc, None, klass))
+ setattr(klass, 'test_' + method + name, new.instancemethod(mc, None, klass))
for cmb in list(itertools.product((True, False), repeat=4)):
name = ('_' if cmb[0] else '_not_') + 'persistent_'
@@ -168,6 +219,12 @@ for cmb in list(itertools.product((True, False), repeat=4)):
inject_test_case(TestDirtyBitmapMigration, name, 'do_test_migration',
*list(cmb))
+for cmb in list(itertools.product((True, False), repeat=2)):
+ name = ('_' if cmb[0] else '_not_') + 'persistent_'
+ name += ('_' if cmb[1] else '_not_') + 'migbitmap'
+
+ inject_test_case(TestDirtyBitmapMigration, name,
+ 'do_test_migration_resume_source', *list(cmb))
if __name__ == '__main__':
iotests.main(supported_fmts=['qcow2'])
diff --git a/tests/qemu-iotests/169.out b/tests/qemu-iotests/169.out
index b6f257674e..3a89159833 100644
--- a/tests/qemu-iotests/169.out
+++ b/tests/qemu-iotests/169.out
@@ -1,5 +1,5 @@
-................
+....................
----------------------------------------------------------------------
-Ran 16 tests
+Ran 20 tests
OK
--
2.14.4
^ permalink raw reply related
* [Qemu-devel] [PATCH for-3.0 2/7] block/qcow2: improve error message in qcow2_inactivate
From: John Snow @ 2018-07-23 22:22 UTC (permalink / raw)
To: qemu-devel, qemu-block
Cc: Juan Quintela, qemu-stable, Dr. David Alan Gilbert, John Snow,
Fam Zheng, Kevin Wolf, Stefan Hajnoczi, eblake, Max Reitz,
Vladimir Sementsov-Ogievskiy
In-Reply-To: <20180723222210.11077-1-jsnow@redhat.com>
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: John Snow <jsnow@redhat.com>
---
block/qcow2.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 6162ed8be2..7444133ccd 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2127,9 +2127,9 @@ static int qcow2_inactivate(BlockDriverState *bs)
qcow2_store_persistent_dirty_bitmaps(bs, &local_err);
if (local_err != NULL) {
result = -EINVAL;
- error_report_err(local_err);
- error_report("Persistent bitmaps are lost for node '%s'",
- bdrv_get_device_or_node_name(bs));
+ error_reportf_err(local_err, "Lost persistent bitmaps during "
+ "inactivation of node '%s': ",
+ bdrv_get_device_or_node_name(bs));
}
ret = qcow2_cache_flush(bs, s->l2_table_cache);
--
2.14.4
^ permalink raw reply related
* [Qemu-devel] [PATCH for-3.0 5/7] dirty-bitmaps: clean-up bitmaps loading and migration logic
From: John Snow @ 2018-07-23 22:22 UTC (permalink / raw)
To: qemu-devel, qemu-block
Cc: Juan Quintela, qemu-stable, Dr. David Alan Gilbert, John Snow,
Fam Zheng, Kevin Wolf, Stefan Hajnoczi, eblake, Max Reitz,
Vladimir Sementsov-Ogievskiy
In-Reply-To: <20180723222210.11077-1-jsnow@redhat.com>
This patch aims to bring the following behavior:
1. Bitmaps are not loaded on open if BDRV_O_INACTIVE is set, which occurs
for incoming migration cases. We will load these persistent bitmaps
on invalidate instead.
2. Regardless of the migration circumstances, persistent bitmaps are
always flushed to disk on inactivate or close.
3. Bitmaps are read from disk and loaded into memory on any invalidation:
A) Normal, RW open
B) Migration target invalidation: With or without dirty-bitmaps
capability, any bitmaps found on-disk will be loaded.
C) Migration source invalidation: If the migration fails and the
source QEMU is resumed, it will re-load bitmaps from disk.
4. When using the dirty-bitmaps migration capability, persistent bitmaps
are skipped if we are performing a shared storage migration. The
destination QEMU will load them from disk on invalidate.
(Transient, non-persistent bitmaps still get migrated.)
For block migrations, persistent bitmaps are both flushed to disk
on the source and migrated live across the migration channel.
5. Persistent bitmaps are not unloaded from memory in the inactivate
handler. Instead, they are removed on-store which occurs during
inactivate. The effect is functionally the same, but keeps bitmap
management more inside the module.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: John Snow <jsnow@redhat.com>
---
block.c | 4 ----
block/dirty-bitmap.c | 20 --------------------
block/qcow2-bitmap.c | 16 ++++++++++++++++
block/qcow2.c | 5 +++--
include/block/dirty-bitmap.h | 2 +-
migration/block-dirty-bitmap.c | 11 ++++++-----
6 files changed, 26 insertions(+), 32 deletions(-)
diff --git a/block.c b/block.c
index a2fe05ea96..f16bf106d1 100644
--- a/block.c
+++ b/block.c
@@ -4497,10 +4497,6 @@ static int bdrv_inactivate_recurse(BlockDriverState *bs,
}
}
- /* At this point persistent bitmaps should be already stored by the format
- * driver */
- bdrv_release_persistent_dirty_bitmaps(bs);
-
return 0;
}
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index c9b8a6fd52..e44061fe2e 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -383,26 +383,6 @@ void bdrv_release_named_dirty_bitmaps(BlockDriverState *bs)
bdrv_dirty_bitmaps_unlock(bs);
}
-/**
- * Release all persistent dirty bitmaps attached to a BDS (for use in
- * bdrv_inactivate_recurse()).
- * There must not be any frozen bitmaps attached.
- * This function does not remove persistent bitmaps from the storage.
- * Called with BQL taken.
- */
-void bdrv_release_persistent_dirty_bitmaps(BlockDriverState *bs)
-{
- BdrvDirtyBitmap *bm, *next;
-
- bdrv_dirty_bitmaps_lock(bs);
- QLIST_FOREACH_SAFE(bm, &bs->dirty_bitmaps, list, next) {
- if (bdrv_dirty_bitmap_get_persistance(bm)) {
- bdrv_release_dirty_bitmap_locked(bm);
- }
- }
- bdrv_dirty_bitmaps_unlock(bs);
-}
-
/**
* Remove persistent dirty bitmap from the storage if it exists.
* Absence of bitmap is not an error, because we have the following scenario:
diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index ba978ad2aa..b5f1b3563d 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -1418,6 +1418,22 @@ void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs, Error **errp)
g_free(tb);
}
+ QSIMPLEQ_FOREACH(bm, bm_list, entry) {
+ /* For safety, we remove bitmap after storing.
+ * We may be here in two cases:
+ * 1. bdrv_close. It's ok to drop bitmap.
+ * 2. inactivation. It means migration without 'dirty-bitmaps'
+ * capability, so bitmaps are not marked with
+ * BdrvDirtyBitmap.migration flags. It's not bad to drop them too,
+ * and reload on invalidation.
+ */
+ if (bm->dirty_bitmap == NULL) {
+ continue;
+ }
+
+ bdrv_release_dirty_bitmap(bs, bm->dirty_bitmap);
+ }
+
bitmap_list_free(bm_list);
return;
diff --git a/block/qcow2.c b/block/qcow2.c
index 72d4e67b99..b958cec83d 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1495,8 +1495,9 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
s->autoclear_features &= QCOW2_AUTOCLEAR_MASK;
}
- if (qcow2_load_dirty_bitmaps(bs, &local_err)) {
- update_header = false;
+ if (!(bdrv_get_flags(bs) & BDRV_O_INACTIVE)) {
+ bool header_updated = qcow2_load_dirty_bitmaps(bs, &local_err);
+ update_header = update_header && !header_updated;
}
if (local_err != NULL) {
error_propagate(errp, local_err);
diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h
index 259bd27c40..95c7847ec6 100644
--- a/include/block/dirty-bitmap.h
+++ b/include/block/dirty-bitmap.h
@@ -26,7 +26,6 @@ BdrvDirtyBitmap *bdrv_find_dirty_bitmap(BlockDriverState *bs,
const char *name);
void bdrv_release_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap);
void bdrv_release_named_dirty_bitmaps(BlockDriverState *bs);
-void bdrv_release_persistent_dirty_bitmaps(BlockDriverState *bs);
void bdrv_remove_persistent_dirty_bitmap(BlockDriverState *bs,
const char *name,
Error **errp);
@@ -72,6 +71,7 @@ void bdrv_dirty_bitmap_set_persistance(BdrvDirtyBitmap *bitmap,
void bdrv_dirty_bitmap_set_qmp_locked(BdrvDirtyBitmap *bitmap, bool qmp_locked);
void bdrv_merge_dirty_bitmap(BdrvDirtyBitmap *dest, const BdrvDirtyBitmap *src,
Error **errp);
+void bdrv_dirty_bitmap_set_migration(BdrvDirtyBitmap *bitmap, bool migration);
/* Functions that require manual locking. */
void bdrv_dirty_bitmap_lock(BdrvDirtyBitmap *bitmap);
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 477826330c..dac8270d1f 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -295,6 +295,12 @@ static int init_dirty_bitmap_migration(void)
continue;
}
+ /* Skip persistant bitmaps, unless it's a block migration: */
+ if (bdrv_dirty_bitmap_get_persistance(bitmap) &&
+ !migrate_use_block()) {
+ continue;
+ }
+
if (drive_name == NULL) {
error_report("Found bitmap '%s' in unnamed node %p. It can't "
"be migrated", bdrv_dirty_bitmap_name(bitmap), bs);
@@ -335,11 +341,6 @@ static int init_dirty_bitmap_migration(void)
}
}
- /* unset persistance here, to not roll back it */
- QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
- bdrv_dirty_bitmap_set_persistance(dbms->bitmap, false);
- }
-
if (QSIMPLEQ_EMPTY(&dirty_bitmap_mig_state.dbms_list)) {
dirty_bitmap_mig_state.no_bitmaps = true;
}
--
2.14.4
^ permalink raw reply related
* [Qemu-devel] [PATCH for-3.0 3/7] block/qcow2: drop dirty_bitmaps_loaded state variable
From: John Snow @ 2018-07-23 22:22 UTC (permalink / raw)
To: qemu-devel, qemu-block
Cc: Juan Quintela, qemu-stable, Dr. David Alan Gilbert, John Snow,
Fam Zheng, Kevin Wolf, Stefan Hajnoczi, eblake, Max Reitz,
Vladimir Sementsov-Ogievskiy
In-Reply-To: <20180723222210.11077-1-jsnow@redhat.com>
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
This variable doesn't work as it should, because it is actually cleared
in qcow2_co_invalidate_cache() by memset(). Drop it, as the following
patch will introduce new behavior.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
---
block/qcow2.c | 19 ++-----------------
block/qcow2.h | 1 -
2 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 7444133ccd..72d4e67b99 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1157,7 +1157,6 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
uint64_t ext_end;
uint64_t l1_vm_state_index;
bool update_header = false;
- bool header_updated = false;
ret = bdrv_pread(bs->file, 0, &header, sizeof(header));
if (ret < 0) {
@@ -1496,23 +1495,9 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
s->autoclear_features &= QCOW2_AUTOCLEAR_MASK;
}
- if (s->dirty_bitmaps_loaded) {
- /* It's some kind of reopen. There are no known cases where we need to
- * reload bitmaps in such a situation, so it's safer to skip them.
- *
- * Moreover, if we have some readonly bitmaps and we are reopening for
- * rw we should reopen bitmaps correspondingly.
- */
- if (bdrv_has_readonly_bitmaps(bs) &&
- !bdrv_is_read_only(bs) && !(bdrv_get_flags(bs) & BDRV_O_INACTIVE))
- {
- qcow2_reopen_bitmaps_rw_hint(bs, &header_updated, &local_err);
- }
- } else {
- header_updated = qcow2_load_dirty_bitmaps(bs, &local_err);
- s->dirty_bitmaps_loaded = true;
+ if (qcow2_load_dirty_bitmaps(bs, &local_err)) {
+ update_header = false;
}
- update_header = update_header && !header_updated;
if (local_err != NULL) {
error_propagate(errp, local_err);
ret = -EINVAL;
diff --git a/block/qcow2.h b/block/qcow2.h
index 81b844e936..4b4e61fe61 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -295,7 +295,6 @@ typedef struct BDRVQcow2State {
uint32_t nb_bitmaps;
uint64_t bitmap_directory_size;
uint64_t bitmap_directory_offset;
- bool dirty_bitmaps_loaded;
int flags;
int qcow_version;
--
2.14.4
^ permalink raw reply related
* [Qemu-devel] [PATCH for-3.0 6/7] iotests: improve 169
From: John Snow @ 2018-07-23 22:22 UTC (permalink / raw)
To: qemu-devel, qemu-block
Cc: Juan Quintela, qemu-stable, Dr. David Alan Gilbert, John Snow,
Fam Zheng, Kevin Wolf, Stefan Hajnoczi, eblake, Max Reitz,
Vladimir Sementsov-Ogievskiy
In-Reply-To: <20180723222210.11077-1-jsnow@redhat.com>
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Before previous patch, iotest 169 was actually broken for the case
test_persistent__not_migbitmap__offline_shared, while formally
passing.
After migration log of vm_b had message:
qemu-system-x86_64: Could not reopen qcow2 layer: Bitmap already
exists: bitmap0
which means that invalidation failed and bs->drv = NULL.
It was because we've loaded bitmap twice: on open and on invalidation.
Add code to 169, to catch such fails.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/169 | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tests/qemu-iotests/169 b/tests/qemu-iotests/169
index 87edc85f43..24027da8e1 100755
--- a/tests/qemu-iotests/169
+++ b/tests/qemu-iotests/169
@@ -24,6 +24,7 @@ import time
import itertools
import operator
import new
+import re
from iotests import qemu_img
@@ -136,6 +137,16 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase):
if should_migrate:
self.vm_b.shutdown()
+
+ # catch 'Could not reopen qcow2 layer: Bitmap already exists'
+ # possible error
+ log = self.vm_b.get_log()
+ log = re.sub(r'^\[I \d+\.\d+\] OPENED\n', '', log)
+ log = re.sub(r'Receiving block device images\n', '', log)
+ log = re.sub(r'Completed \d+ %\r?\n?', '', log)
+ log = re.sub(r'\[I \+\d+\.\d+\] CLOSED\n?$', '', log)
+ self.assertEqual(log, '')
+
# recreate vm_b, as we don't want -incoming option (this will lead
# to "cat" process left alive after test finish)
self.vm_b = iotests.VM(path_suffix='b')
--
2.14.4
^ permalink raw reply related
* [Qemu-devel] [PATCH for-3.0 0/7] fix persistent bitmaps migration logic
From: John Snow @ 2018-07-23 22:22 UTC (permalink / raw)
To: qemu-devel, qemu-block
Cc: Juan Quintela, qemu-stable, Dr. David Alan Gilbert, John Snow,
Fam Zheng, Kevin Wolf, Stefan Hajnoczi, eblake, Max Reitz
This is an updated version of Vladimir's proposal for fixing the
handling around migration and persistent dirty bitmaps.
Patches 1, 4, 6, and 7 update the testing for this feature.
Patch 2 touches up an error message.
Patch 3 removes dead code.
Patch 5 contains the real fix.
v2:
- Add a new patch 4 as a prerequisite for what's now patch 5
- Rework the fix to be (hopefully) cleaner, see patch 5 notes
- Adjust error message in patch 2 (Eric)
- Adjust test logic slightly (patches 6, 7) to deal with changes
in patch 5.
John Snow (2):
iotests: 169: actually test block migration
dirty-bitmaps: clean-up bitmaps loading and migration logic
Vladimir Sementsov-Ogievskiy (5):
iotests: 169: drop deprecated 'autoload' parameter
block/qcow2: improve error message in qcow2_inactivate
block/qcow2: drop dirty_bitmaps_loaded state variable
iotests: improve 169
iotests: 169: add cases for source vm resuming
block.c | 4 ---
block/dirty-bitmap.c | 20 ------------
block/qcow2-bitmap.c | 16 +++++++++
block/qcow2.c | 26 ++++-----------
block/qcow2.h | 1 -
include/block/dirty-bitmap.h | 2 +-
migration/block-dirty-bitmap.c | 11 ++++---
tests/qemu-iotests/169 | 74 ++++++++++++++++++++++++++++++++++++++++--
tests/qemu-iotests/169.out | 4 +--
9 files changed, 103 insertions(+), 55 deletions(-)
--
2.14.4
^ permalink raw reply
* [Qemu-devel] [PATCH for-3.0 1/7] iotests: 169: drop deprecated 'autoload' parameter
From: John Snow @ 2018-07-23 22:22 UTC (permalink / raw)
To: qemu-devel, qemu-block
Cc: Juan Quintela, qemu-stable, Dr. David Alan Gilbert, John Snow,
Fam Zheng, Kevin Wolf, Stefan Hajnoczi, eblake, Max Reitz,
Vladimir Sementsov-Ogievskiy
In-Reply-To: <20180723222210.11077-1-jsnow@redhat.com>
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 20180626135035.133432-2-vsementsov@virtuozzo.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/169 | 1 -
1 file changed, 1 deletion(-)
diff --git a/tests/qemu-iotests/169 b/tests/qemu-iotests/169
index f243db9955..df408f8367 100755
--- a/tests/qemu-iotests/169
+++ b/tests/qemu-iotests/169
@@ -58,7 +58,6 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase):
'granularity': granularity}
if persistent:
params['persistent'] = True
- params['autoload'] = True
result = vm.qmp('block-dirty-bitmap-add', **params)
self.assert_qmp(result, 'return', {});
--
2.14.4
^ permalink raw reply related
* [Qemu-devel] [PATCH for-3.0 4/7] iotests: 169: actually test block migration
From: John Snow @ 2018-07-23 22:22 UTC (permalink / raw)
To: qemu-devel, qemu-block
Cc: Juan Quintela, qemu-stable, Dr. David Alan Gilbert, John Snow,
Fam Zheng, Kevin Wolf, Stefan Hajnoczi, eblake, Max Reitz
In-Reply-To: <20180723222210.11077-1-jsnow@redhat.com>
Presently, we emulate a block migration by just using a different
target file. Update the test to actually request a block migration.
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/169 | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/qemu-iotests/169 b/tests/qemu-iotests/169
index df408f8367..87edc85f43 100755
--- a/tests/qemu-iotests/169
+++ b/tests/qemu-iotests/169
@@ -89,6 +89,9 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase):
mig_caps = [{'capability': 'events', 'state': True}]
if migrate_bitmaps:
mig_caps.append({'capability': 'dirty-bitmaps', 'state': True})
+ if not shared_storage:
+ mig_caps.append({'capability': 'block', 'state': True})
+
result = self.vm_a.qmp('migrate-set-capabilities',
capabilities=mig_caps)
--
2.14.4
^ permalink raw reply related
* [U-Boot] [PATCH] sunxi: enable SATA on Banana Pi M2 Berry
From: Simon Baatz @ 2018-07-23 22:22 UTC (permalink / raw)
To: u-boot
Banana Pi M2 Ultra and M2 Berry are very similar boards. SATA can be
enabled exactly the same as for M2 Ultra introduced in
commit daa8b75a5527 ("sunxi: enable SATA on Banana Pi M2 Ultra").
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
configs/bananapi_m2_berry_defconfig | 3 +++
1 file changed, 3 insertions(+)
diff --git a/configs/bananapi_m2_berry_defconfig b/configs/bananapi_m2_berry_defconfig
index 9d75108d04..313e09a764 100644
--- a/configs/bananapi_m2_berry_defconfig
+++ b/configs/bananapi_m2_berry_defconfig
@@ -7,8 +7,11 @@ CONFIG_DRAM_ZQ=3881979
CONFIG_DRAM_ODT_EN=y
CONFIG_MMC0_CD_PIN="PH13"
CONFIG_DEFAULT_DEVICE_TREE="sun8i-v40-bananapi-m2-berry"
+CONFIG_AHCI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_SPL_I2C_SUPPORT=y
# CONFIG_CMD_FLASH is not set
+CONFIG_SCSI_AHCI=y
CONFIG_AXP_DLDO4_VOLT=2500
CONFIG_AXP_ELDO3_VOLT=1200
+CONFIG_SCSI=y
--
2.17.1
^ permalink raw reply related
* Re: [PATCH net-next 3/4] net/tc: introduce TC_ACT_MIRRED.
From: Cong Wang @ 2018-07-23 21:12 UTC (permalink / raw)
To: Paolo Abeni
Cc: Jiri Pirko, Linux Kernel Network Developers, Jamal Hadi Salim,
Daniel Borkmann, Marcelo Ricardo Leitner, Eyal Birger
In-Reply-To: <202e02c5fa084874e48b9347f09b256f23e63d91.camel@redhat.com>
On Fri, Jul 20, 2018 at 2:54 AM Paolo Abeni <pabeni@redhat.com> wrote:
>
> Hi,
>
> Jiri, Cong, thank you for the feedback. Please allow me to give a
> single reply to both of you, as you rised similar concers.
>
> On Thu, 2018-07-19 at 11:07 -0700, Cong Wang wrote:
> > On Thu, Jul 19, 2018 at 6:03 AM Paolo Abeni <pabeni@redhat.com> wrote:
> > >
> > > This is similar TC_ACT_REDIRECT, but with a slightly different
> > > semantic:
> > > - on ingress the mirred skbs are passed to the target device
> > > network stack without any additional check not scrubbing.
> > > - the rcu-protected stats provided via the tcf_result struct
> > > are updated on error conditions.
> >
> > At least its name sucks, it means to skip the skb_clone(),
> > that is avoid a copy, but you still call it MIRRED...
> >
> > MIRRED means MIRror and REDirect.
>
> I was not satified with the name, too, but I also wanted to collect
> some feedback, as the different time zones are not helping here.
>
> Would TC_ACT_REINJECT be a better choice? (renaming skb_tc_redirect as
> skb_tc_reinject, too). Do you have some better name?
Any name not implying a copy is better. I don't worry about it, please
see below.
> > Also, I don't understand why this new TC_ACT code needs
> > to be visible to user-space, whether to clone or not is purely
> > internal.
>
> Note this is what already happens with TC_ACT_REDIRECT: currently the
> user space uses it freely, even if only {cls,act}_bpf can return such
> value in a meaningful way, and only from the ingress and the egress
> hooks.
>
Yes, my question is why do we give user such a freedom?
In other words, what do you want users to choose here? To scrub or not
to scrub? To clone or not to clone?
>From my understanding of your whole patchset, your goal is to get rid
of clone, and users definitely don't care about clone or not clone for
redirections, this is why I insist it doesn't need to be visible to user.
If your goal is not just skipping clone, but also, let's say, scrub or not
scrub, then it should be visible to users. However, I don't see why
users care about scrub or not, they have to understand what scrub
is at least, it is a purely kernel-internal behavior.
> I think we can add a clear separation between the values accessible
> from user-space, and the ones used interanally by the kernel, with
> something like the code below (basically unknown actions are explicitly
> mapped to TC_ACT_UNSPEC), WDYT?
>
> Note: as TC_ACT_REDIRECT is already part of the uAPI, it will remain
> accessible from user-space, so patch 1/4 would be still needed.
I think that is doable too, but we should understand whether we
need to do it or not at first.
Thanks.
^ permalink raw reply
* [PATCH] Staging: octeon: Apply Licence and resolves warnings according to TODO list. There are also a few "checks" that probably should revised but i think most of them could be resolved by breaking down cvmx_usb_poll_channel()
From: Georgios Tsotsos @ 2018-07-23 22:21 UTC (permalink / raw)
To: gregkh; +Cc: aaro.koskinen, jhogan, devel, linux-kernel, Georgios Tsotsos
Signed-off-by: Georgios Tsotsos <tsotsos@gmail.com>
---
drivers/staging/octeon-usb/octeon-hcd.c | 55 ++++++++++++++++++---------------
drivers/staging/octeon-usb/octeon-hcd.h | 1 +
2 files changed, 31 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index cded30f145aa..472ad5917ad2 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -377,27 +378,29 @@ struct octeon_hcd {
};
/* This macro spins on a register waiting for it to reach a condition. */
-#define CVMX_WAIT_FOR_FIELD32(address, _union, cond, timeout_usec) \
- ({int result; \
- do { \
- u64 done = cvmx_get_cycle() + (u64)timeout_usec * \
- octeon_get_clock_rate() / 1000000; \
- union _union c; \
- \
- while (1) { \
- c.u32 = cvmx_usb_read_csr32(usb, address); \
- \
- if (cond) { \
- result = 0; \
- break; \
- } else if (cvmx_get_cycle() > done) { \
- result = -1; \
- break; \
- } else \
- __delay(100); \
- } \
- } while (0); \
- result; })
+#define CVMX_WAIT_FOR_FIELD32(address, _union, cond, timeout_usec) \
+({ \
+ int result; \
+ do { \
+ u64 done = cvmx_get_cycle() + (u64)(timeout_usec) * \
+ octeon_get_clock_rate() / 1000000; \
+ union _union c; \
+ \
+ while (1) { \
+ c.u32 = cvmx_usb_read_csr32(usb, address); \
+ \
+ if (cond) { \
+ result = 0; \
+ break; \
+ } else if (cvmx_get_cycle() > done) { \
+ result = -1; \
+ break; \
+ } else \
+ __delay(100); \
+ } \
+ } while (0); \
+ result; \
+})
/*
* This macro logically sets a single field in a CSR. It does the sequence
@@ -2636,12 +2639,14 @@ static int cvmx_usb_poll_channel(struct octeon_hcd *usb, int channel)
hcintmsk.u32 = 0;
hcintmsk.s.chhltdmsk = 1;
cvmx_usb_write_csr32(usb,
- CVMX_USBCX_HCINTMSKX(channel, usb->index),
- hcintmsk.u32);
+ CVMX_USBCX_HCINTMSKX(channel,
+ usb->index),
+ hcintmsk.u32);
usbc_hcchar.s.chdis = 1;
cvmx_usb_write_csr32(usb,
- CVMX_USBCX_HCCHARX(channel, usb->index),
- usbc_hcchar.u32);
+ CVMX_USBCX_HCCHARX(channel,
+ usb->index),
+ usbc_hcchar.u32);
return 0;
} else if (usbc_hcint.s.xfercompl) {
/*
diff --git a/drivers/staging/octeon-usb/octeon-hcd.h b/drivers/staging/octeon-usb/octeon-hcd.h
index 3353aefe662e..769c36cf6614 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.h
+++ b/drivers/staging/octeon-usb/octeon-hcd.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Octeon HCD hardware register definitions.
*
--
2.16.4
^ permalink raw reply related
* Re: [PATCH] tpm: add support for partial reads
From: James Bottomley @ 2018-07-23 21:13 UTC (permalink / raw)
To: Tadeusz Struk, Jarkko Sakkinen
Cc: jgg, linux-integrity, linux-security-module, linux-kernel
In-Reply-To: <fb053916-f6e8-3266-14d7-128e062b6a92@intel.com>
On Mon, 2018-07-23 at 13:53 -0700, Tadeusz Struk wrote:
> On 07/23/2018 01:19 PM, Jarkko Sakkinen wrote:
> > In this case I do not have any major evidence of any major benefit
> > *and* the change breaks the ABI.
>
> As I said before - this does not break the ABI.
The current patch does, you even provided a use case in your last email
(it's do command to get sizing followed by do command with correctly
sized buffer).
However, if you tie it to O_NONBLOCK, it won't because no-one currently
opens the TPM device non blocking so it's an ABI conformant
discriminator of the uses. Tying to O_NONBLOCK should be simple
because it's in file->f_flags.
James
^ permalink raw reply
* Re: [PATCH v7 08/12] mfd: intel-peci-client: Add PECI client MFD driver
From: Randy Dunlap @ 2018-07-23 22:21 UTC (permalink / raw)
To: Jae Hyun Yoo, Jean Delvare, Guenter Roeck, Rob Herring,
Mark Rutland, Lee Jones, Joel Stanley, Andrew Jeffery,
Jonathan Corbet, Greg Kroah-Hartman, Gustavo Pimentel,
Kishon Vijay Abraham I, Lorenzo Pieralisi, Darrick J . Wong,
Eric Sandeen, Arnd Bergmann, Wu Hao, Tomohiro Kusumi,
Bryant G . Ly, Frederic Barrat, David S . Miller,
Mauro Carvalho Chehab
Cc: linux-hwmon, devicetree, linux-aspeed, linux-doc, Vernon Mauery,
openbmc, linux-kernel, James Feist, Jason M Biils,
linux-arm-kernel
In-Reply-To: <20180723214751.1733-9-jae.hyun.yoo@linux.intel.com>
On 07/23/2018 02:47 PM, Jae Hyun Yoo wrote:
> This commit adds PECI client MFD driver.
>
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Andrew Jeffery <andrew@aj.id.au>
> Cc: James Feist <james.feist@linux.intel.com>
> Cc: Jason M Biils <jason.m.bills@linux.intel.com>
> Cc: Joel Stanley <joel@jms.id.au>
> Cc: Vernon Mauery <vernon.mauery@linux.intel.com>
> ---
> drivers/mfd/Kconfig | 14 ++
> drivers/mfd/Makefile | 1 +
> drivers/mfd/intel-peci-client.c | 182 ++++++++++++++++++++++++++
> include/linux/mfd/intel-peci-client.h | 81 ++++++++++++
> 4 files changed, 278 insertions(+)
> create mode 100644 drivers/mfd/intel-peci-client.c
> create mode 100644 include/linux/mfd/intel-peci-client.h
>
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index f3fa516011ec..e38b591479d4 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -595,6 +595,20 @@ config MFD_INTEL_MSIC
> Passage) chip. This chip embeds audio, battery, GPIO, etc.
> devices used in Intel Medfield platforms.
>
> +config MFD_INTEL_PECI_CLIENT
> + bool "Intel PECI client"
> + depends on (PECI || COMPILE_TEST)
> + select MFD_CORE
> + help
> + If you say yes to this option, support will be included for the
> + multi-funtional Intel PECI (Platform Environment Control Interface)
multi-functional
> + client. PECI is a one-wire bus interface that provides a communication
> + channel from PECI clients in Intel processors and chipset components
> + to external monitoring or control devices.
> +
> + Additional drivers must be enabled in order to use the functionality
> + of the device.
> +
> config MFD_IPAQ_MICRO
> bool "Atmel Micro ASIC (iPAQ h3100/h3600/h3700) Support"
> depends on SA1100_H3100 || SA1100_H3600
--
~Randy
^ permalink raw reply
* [PATCH v7 08/12] mfd: intel-peci-client: Add PECI client MFD driver
From: Randy Dunlap @ 2018-07-23 22:21 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180723214751.1733-9-jae.hyun.yoo@linux.intel.com>
On 07/23/2018 02:47 PM, Jae Hyun Yoo wrote:
> This commit adds PECI client MFD driver.
>
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Andrew Jeffery <andrew@aj.id.au>
> Cc: James Feist <james.feist@linux.intel.com>
> Cc: Jason M Biils <jason.m.bills@linux.intel.com>
> Cc: Joel Stanley <joel@jms.id.au>
> Cc: Vernon Mauery <vernon.mauery@linux.intel.com>
> ---
> drivers/mfd/Kconfig | 14 ++
> drivers/mfd/Makefile | 1 +
> drivers/mfd/intel-peci-client.c | 182 ++++++++++++++++++++++++++
> include/linux/mfd/intel-peci-client.h | 81 ++++++++++++
> 4 files changed, 278 insertions(+)
> create mode 100644 drivers/mfd/intel-peci-client.c
> create mode 100644 include/linux/mfd/intel-peci-client.h
>
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index f3fa516011ec..e38b591479d4 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -595,6 +595,20 @@ config MFD_INTEL_MSIC
> Passage) chip. This chip embeds audio, battery, GPIO, etc.
> devices used in Intel Medfield platforms.
>
> +config MFD_INTEL_PECI_CLIENT
> + bool "Intel PECI client"
> + depends on (PECI || COMPILE_TEST)
> + select MFD_CORE
> + help
> + If you say yes to this option, support will be included for the
> + multi-funtional Intel PECI (Platform Environment Control Interface)
multi-functional
> + client. PECI is a one-wire bus interface that provides a communication
> + channel from PECI clients in Intel processors and chipset components
> + to external monitoring or control devices.
> +
> + Additional drivers must be enabled in order to use the functionality
> + of the device.
> +
> config MFD_IPAQ_MICRO
> bool "Atmel Micro ASIC (iPAQ h3100/h3600/h3700) Support"
> depends on SA1100_H3100 || SA1100_H3600
--
~Randy
^ permalink raw reply
* [PATCH v7 08/12] mfd: intel-peci-client: Add PECI client MFD driver
From: Randy Dunlap @ 2018-07-23 22:21 UTC (permalink / raw)
To: linux-aspeed
In-Reply-To: <20180723214751.1733-9-jae.hyun.yoo@linux.intel.com>
On 07/23/2018 02:47 PM, Jae Hyun Yoo wrote:
> This commit adds PECI client MFD driver.
>
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Andrew Jeffery <andrew@aj.id.au>
> Cc: James Feist <james.feist@linux.intel.com>
> Cc: Jason M Biils <jason.m.bills@linux.intel.com>
> Cc: Joel Stanley <joel@jms.id.au>
> Cc: Vernon Mauery <vernon.mauery@linux.intel.com>
> ---
> drivers/mfd/Kconfig | 14 ++
> drivers/mfd/Makefile | 1 +
> drivers/mfd/intel-peci-client.c | 182 ++++++++++++++++++++++++++
> include/linux/mfd/intel-peci-client.h | 81 ++++++++++++
> 4 files changed, 278 insertions(+)
> create mode 100644 drivers/mfd/intel-peci-client.c
> create mode 100644 include/linux/mfd/intel-peci-client.h
>
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index f3fa516011ec..e38b591479d4 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -595,6 +595,20 @@ config MFD_INTEL_MSIC
> Passage) chip. This chip embeds audio, battery, GPIO, etc.
> devices used in Intel Medfield platforms.
>
> +config MFD_INTEL_PECI_CLIENT
> + bool "Intel PECI client"
> + depends on (PECI || COMPILE_TEST)
> + select MFD_CORE
> + help
> + If you say yes to this option, support will be included for the
> + multi-funtional Intel PECI (Platform Environment Control Interface)
multi-functional
> + client. PECI is a one-wire bus interface that provides a communication
> + channel from PECI clients in Intel processors and chipset components
> + to external monitoring or control devices.
> +
> + Additional drivers must be enabled in order to use the functionality
> + of the device.
> +
> config MFD_IPAQ_MICRO
> bool "Atmel Micro ASIC (iPAQ h3100/h3600/h3700) Support"
> depends on SA1100_H3100 || SA1100_H3600
--
~Randy
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.