libnvdimm, btt: add btt startup debug
authorDan Williams <dan.j.williams@intel.com>
Fri, 22 Apr 2016 19:26:05 +0000 (12:26 -0700)
committerDan Williams <dan.j.williams@intel.com>
Fri, 22 Apr 2016 19:26:05 +0000 (12:26 -0700)
Report the reason for btt probe failures when debug is enabled.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/btt.c

index f068b6513cd286659b1e468e726c45d868a05b7b..af09d6c26709566224f92a748bb09cc1dfe62ad5 100644 (file)
@@ -1388,11 +1388,15 @@ int nvdimm_namespace_attach_btt(struct nd_namespace_common *ndns)
        struct btt *btt;
        size_t rawsize;
 
-       if (!nd_btt->uuid || !nd_btt->ndns || !nd_btt->lbasize)
+       if (!nd_btt->uuid || !nd_btt->ndns || !nd_btt->lbasize) {
+               dev_dbg(&nd_btt->dev, "incomplete btt configuration\n");
                return -ENODEV;
+       }
 
        rawsize = nvdimm_namespace_capacity(ndns) - SZ_4K;
        if (rawsize < ARENA_MIN_SIZE) {
+               dev_dbg(&nd_btt->dev, "%s must be at least %ld bytes\n",
+                               dev_name(&ndns->dev), ARENA_MIN_SIZE + SZ_4K);
                return -ENXIO;
        }
        nd_region = to_nd_region(nd_btt->dev.parent);