* [PATCH] dax: clarify driver_data ownership
@ 2016-12-15 6:59 ` Dan Williams
0 siblings, 0 replies; 4+ messages in thread
From: Dan Williams @ 2016-12-15 6:59 UTC (permalink / raw)
To: linux-nvdimm; +Cc: linux-kernel
Johannes points out that the warning in alloc_dax_region() seems to
imply that multiple devices might claim a dax region. In fact it's a
warning to driver developers that the dax core wants to own the
driver_data pointer for the hosting device of a dax_region. Add a
clarification.
Reported-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
drivers/dax/dax.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/dax/dax.c b/drivers/dax/dax.c
index d1641e69a088..c7b23d52f945 100644
--- a/drivers/dax/dax.c
+++ b/drivers/dax/dax.c
@@ -359,8 +359,13 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
{
struct dax_region *dax_region;
+ /*
+ * The DAX core assumes that it can store its private data in
+ * parent->driver_data. This WARN is a reminder / safeguard for
+ * developers of device-dax drivers.
+ */
if (dev_get_drvdata(parent)) {
- dev_WARN(parent, "dax core found drvdata already in use\n");
+ dev_WARN(parent, "dax core failed to setup private data\n");
return NULL;
}
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] dax: clarify driver_data ownership
@ 2016-12-15 6:59 ` Dan Williams
0 siblings, 0 replies; 4+ messages in thread
From: Dan Williams @ 2016-12-15 6:59 UTC (permalink / raw)
To: linux-nvdimm; +Cc: linux-kernel, Johannes Thumshirn
Johannes points out that the warning in alloc_dax_region() seems to
imply that multiple devices might claim a dax region. In fact it's a
warning to driver developers that the dax core wants to own the
driver_data pointer for the hosting device of a dax_region. Add a
clarification.
Reported-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
drivers/dax/dax.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/dax/dax.c b/drivers/dax/dax.c
index d1641e69a088..c7b23d52f945 100644
--- a/drivers/dax/dax.c
+++ b/drivers/dax/dax.c
@@ -359,8 +359,13 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
{
struct dax_region *dax_region;
+ /*
+ * The DAX core assumes that it can store its private data in
+ * parent->driver_data. This WARN is a reminder / safeguard for
+ * developers of device-dax drivers.
+ */
if (dev_get_drvdata(parent)) {
- dev_WARN(parent, "dax core found drvdata already in use\n");
+ dev_WARN(parent, "dax core failed to setup private data\n");
return NULL;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] dax: clarify driver_data ownership
2016-12-15 6:59 ` Dan Williams
@ 2016-12-15 8:53 ` Johannes Thumshirn
-1 siblings, 0 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2016-12-15 8:53 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-kernel, linux-nvdimm
On Wed, Dec 14, 2016 at 10:59:59PM -0800, Dan Williams wrote:
> Johannes points out that the warning in alloc_dax_region() seems to
> imply that multiple devices might claim a dax region. In fact it's a
> warning to driver developers that the dax core wants to own the
> driver_data pointer for the hosting device of a dax_region. Add a
> clarification.
>
> Reported-by: Johannes Thumshirn <jthumshirn@suse.de>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dax: clarify driver_data ownership
@ 2016-12-15 8:53 ` Johannes Thumshirn
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2016-12-15 8:53 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-nvdimm, linux-kernel
On Wed, Dec 14, 2016 at 10:59:59PM -0800, Dan Williams wrote:
> Johannes points out that the warning in alloc_dax_region() seems to
> imply that multiple devices might claim a dax region. In fact it's a
> warning to driver developers that the dax core wants to own the
> driver_data pointer for the hosting device of a dax_region. Add a
> clarification.
>
> Reported-by: Johannes Thumshirn <jthumshirn@suse.de>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-15 8:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-15 6:59 [PATCH] dax: clarify driver_data ownership Dan Williams
2016-12-15 6:59 ` Dan Williams
2016-12-15 8:53 ` Johannes Thumshirn
2016-12-15 8:53 ` Johannes Thumshirn
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.