Skip to content

Commit 653d782

Browse files
djbwakpm00
authored andcommitted
dcssblk: mark DAX broken, remove FS_DAX_LIMITED support
The dcssblk driver has long needed special case supoprt to enable limited dax operation, so called CONFIG_FS_DAX_LIMITED. This mode works around the incomplete support for ZONE_DEVICE on s390 by forgoing the ability of dax-mapped pages to support GUP. Now, pending cleanups to fsdax that fix its reference counting [1] depend on the ability of all dax drivers to supply ZONE_DEVICE pages. To allow that work to move forward, dax support needs to be paused for dcssblk until ZONE_DEVICE support arrives. That work has been known for a few years [2], and the removal of "pte_devmap" requirements [3] makes the conversion easier. For now, place the support behind CONFIG_BROKEN, and remove PFN_SPECIAL (dcssblk was the only user). Link: http://lore.kernel.org/cover.9f0e45d52f5cff58807831b6b867084d0b14b61c.1725941415.git-series.apopple@nvidia.com [1] Link: http://lore.kernel.org/20210820210318.187742e8@thinkpad/ [2] Link: http://lore.kernel.org/4511465a4f8429f45e2ac70d2e65dc5e1df1eb47.1725941415.git-series.apopple@nvidia.com [3] Link: https://lkml.kernel.org/r/33eef2379c0d240f40cc15453fad2df1a4ae34c8.1740713401.git-series.apopple@nvidia.com Signed-off-by: Dan Williams <[email protected]> Reviewed-by: Gerald Schaefer <[email protected]> Tested-by: Alexander Gordeev <[email protected]> Acked-by: David Hildenbrand <[email protected]> Tested-by: Alison Schofield <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Jan Kara <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Alistair Popple <[email protected]> Cc: Asahi Lina <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Chunyan Zhang <[email protected]> Cc: "Darrick J. Wong" <[email protected]> Cc: Dave Chinner <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Dave Jiang <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Ira Weiny <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: John Hubbard <[email protected]> Cc: linmiaohe <[email protected]> Cc: Logan Gunthorpe <[email protected]> Cc: Michael "Camp Drill Sergeant" Ellerman <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Peter Xu <[email protected]> Cc: Ted Ts'o <[email protected]> Cc: Vishal Verma <[email protected]> Cc: Vivek Goyal <[email protected]> Cc: WANG Xuerui <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent e5cb232 commit 653d782

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

Documentation/filesystems/dax.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ implement direct_access.
207207

208208
These block devices may be used for inspiration:
209209
- brd: RAM backed block device driver
210-
- dcssblk: s390 dcss block device driver
211210
- pmem: NVDIMM persistent memory driver
212211

213212

drivers/s390/block/Kconfig

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ comment "S/390 block device drivers"
44

55
config DCSSBLK
66
def_tristate m
7-
select FS_DAX_LIMITED
8-
select DAX
97
prompt "DCSSBLK support"
108
depends on S390 && BLOCK
119
help
1210
Support for dcss block device
1311

12+
config DCSSBLK_DAX
13+
def_bool y
14+
depends on DCSSBLK
15+
# requires S390 ZONE_DEVICE support
16+
depends on BROKEN
17+
select DAX
18+
prompt "DCSSBLK DAX support"
19+
help
20+
Enable DAX operation for the dcss block device
21+
1422
config DASD
1523
def_tristate y
1624
prompt "Support for DASD devices"

drivers/s390/block/dcssblk.c

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,21 @@ static const struct attribute_group *dcssblk_dev_attr_groups[] = {
534534
NULL,
535535
};
536536

537+
static int dcssblk_setup_dax(struct dcssblk_dev_info *dev_info)
538+
{
539+
struct dax_device *dax_dev;
540+
541+
if (!IS_ENABLED(CONFIG_DCSSBLK_DAX))
542+
return 0;
543+
544+
dax_dev = alloc_dax(dev_info, &dcssblk_dax_ops);
545+
if (IS_ERR(dax_dev))
546+
return PTR_ERR(dax_dev);
547+
set_dax_synchronous(dax_dev);
548+
dev_info->dax_dev = dax_dev;
549+
return dax_add_host(dev_info->dax_dev, dev_info->gd);
550+
}
551+
537552
/*
538553
* device attribute for adding devices
539554
*/
@@ -547,7 +562,6 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
547562
int rc, i, j, num_of_segments;
548563
struct dcssblk_dev_info *dev_info;
549564
struct segment_info *seg_info, *temp;
550-
struct dax_device *dax_dev;
551565
char *local_buf;
552566
unsigned long seg_byte_size;
553567

@@ -674,14 +688,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
674688
if (rc)
675689
goto put_dev;
676690

677-
dax_dev = alloc_dax(dev_info, &dcssblk_dax_ops);
678-
if (IS_ERR(dax_dev)) {
679-
rc = PTR_ERR(dax_dev);
680-
goto put_dev;
681-
}
682-
set_dax_synchronous(dax_dev);
683-
dev_info->dax_dev = dax_dev;
684-
rc = dax_add_host(dev_info->dax_dev, dev_info->gd);
691+
rc = dcssblk_setup_dax(dev_info);
685692
if (rc)
686693
goto out_dax;
687694

@@ -917,7 +924,7 @@ __dcssblk_direct_access(struct dcssblk_dev_info *dev_info, pgoff_t pgoff,
917924
*kaddr = __va(dev_info->start + offset);
918925
if (pfn)
919926
*pfn = __pfn_to_pfn_t(PFN_DOWN(dev_info->start + offset),
920-
PFN_DEV|PFN_SPECIAL);
927+
PFN_DEV);
921928

922929
return (dev_sz - offset) / PAGE_SIZE;
923930
}

0 commit comments

Comments
 (0)