Skip to content

Commit 1592614

Browse files
committed
Merge tag 'for-5.7/drivers-2020-03-29' of git://git.kernel.dk/linux-block
Pull block driver updates from Jens Axboe: - floppy driver cleanup series from Willy - NVMe updates and fixes (Various) - null_blk trace improvements (Chaitanya) - bcache fixes (Coly) - md fixes (via Song) - loop block size change optimizations (Martijn) - scnprintf() use (Takashi) * tag 'for-5.7/drivers-2020-03-29' of git://git.kernel.dk/linux-block: (81 commits) null_blk: add trace in null_blk_zoned.c null_blk: add tracepoint helpers for zoned mode block: add a zone condition debug helper nvme: cleanup namespace identifier reporting in nvme_init_ns_head nvme: rename __nvme_find_ns_head to nvme_find_ns_head nvme: refactor nvme_identify_ns_descs error handling nvme-tcp: Add warning on state change failure at nvme_tcp_setup_ctrl nvme-rdma: Add warning on state change failure at nvme_rdma_setup_ctrl nvme: Fix controller creation races with teardown flow nvme: Make nvme_uninit_ctrl symmetric to nvme_init_ctrl nvme: Fix ctrl use-after-free during sysfs deletion nvme-pci: Re-order nvme_pci_free_ctrl nvme: Remove unused return code from nvme_delete_ctrl_sync nvme: Use nvme_state_terminal helper nvme: release ida resources nvme: Add compat_ioctl handler for NVME_IOCTL_SUBMIT_IO nvmet-tcp: optimize tcp stack TX when data digest is used nvme-fabrics: Use scnprintf() for avoiding potential buffer overflow nvme-multipath: do not reset on unknown status nvmet-rdma: allocate RW ctxs according to mdts ...
2 parents 10f36b1 + 766c329 commit 1592614

39 files changed

Lines changed: 1774 additions & 976 deletions

‎arch/arm/include/asm/floppy.h‎

Lines changed: 13 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@
88
*/
99
#ifndef __ASM_ARM_FLOPPY_H
1010
#define __ASM_ARM_FLOPPY_H
11-
#if 0
12-
#include <mach/floppy.h>
13-
#endif
1411

15-
#define fd_outb(val,port) \
16-
do { \
17-
if ((port) == (u32)FD_DOR) \
18-
fd_setdor((val)); \
19-
else \
20-
outb((val),(port)); \
12+
#define fd_outb(val,port) \
13+
do { \
14+
int new_val = (val); \
15+
if (((port) & 7) == FD_DOR) { \
16+
if (new_val & 0xf0) \
17+
new_val = (new_val & 0x0c) | \
18+
floppy_selects[new_val & 3]; \
19+
else \
20+
new_val &= 0x0c; \
21+
} \
22+
outb(new_val, (port)); \
2123
} while(0)
2224

2325
#define fd_inb(port) inb((port))
@@ -53,69 +55,7 @@ static inline int fd_dma_setup(void *data, unsigned int length,
5355
* to a non-zero track, and then restoring it to track 0. If an error occurs,
5456
* then there is no floppy drive present. [to be put back in again]
5557
*/
56-
static unsigned char floppy_selects[2][4] =
57-
{
58-
{ 0x10, 0x21, 0x23, 0x33 },
59-
{ 0x10, 0x21, 0x23, 0x33 }
60-
};
61-
62-
#define fd_setdor(dor) \
63-
do { \
64-
int new_dor = (dor); \
65-
if (new_dor & 0xf0) \
66-
new_dor = (new_dor & 0x0c) | floppy_selects[fdc][new_dor & 3]; \
67-
else \
68-
new_dor &= 0x0c; \
69-
outb(new_dor, FD_DOR); \
70-
} while (0)
71-
72-
/*
73-
* Someday, we'll automatically detect which drives are present...
74-
*/
75-
static inline void fd_scandrives (void)
76-
{
77-
#if 0
78-
int floppy, drive_count;
79-
80-
fd_disable_irq();
81-
raw_cmd = &default_raw_cmd;
82-
raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_SEEK;
83-
raw_cmd->track = 0;
84-
raw_cmd->rate = ?;
85-
drive_count = 0;
86-
for (floppy = 0; floppy < 4; floppy ++) {
87-
current_drive = drive_count;
88-
/*
89-
* Turn on floppy motor
90-
*/
91-
if (start_motor(redo_fd_request))
92-
continue;
93-
/*
94-
* Set up FDC
95-
*/
96-
fdc_specify();
97-
/*
98-
* Tell FDC to recalibrate
99-
*/
100-
output_byte(FD_RECALIBRATE);
101-
LAST_OUT(UNIT(floppy));
102-
/* wait for command to complete */
103-
if (!successful) {
104-
int i;
105-
for (i = drive_count; i < 3; i--)
106-
floppy_selects[fdc][i] = floppy_selects[fdc][i + 1];
107-
floppy_selects[fdc][3] = 0;
108-
floppy -= 1;
109-
} else
110-
drive_count++;
111-
}
112-
#else
113-
floppy_selects[0][0] = 0x10;
114-
floppy_selects[0][1] = 0x21;
115-
floppy_selects[0][2] = 0x23;
116-
floppy_selects[0][3] = 0x33;
117-
#endif
118-
}
58+
static unsigned char floppy_selects[4] = { 0x10, 0x21, 0x23, 0x33 };
11959

12060
#define FDC1 (0x3f0)
12161

@@ -135,9 +75,7 @@ static inline void fd_scandrives (void)
13575
*/
13676
static void driveswap(int *ints, int dummy, int dummy2)
13777
{
138-
floppy_selects[0][0] ^= floppy_selects[0][1];
139-
floppy_selects[0][1] ^= floppy_selects[0][0];
140-
floppy_selects[0][0] ^= floppy_selects[0][1];
78+
swap(floppy_selects[0], floppy_selects[1]);
14179
}
14280

14381
#define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 }

‎block/blk-settings.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,9 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
628628
printk(KERN_NOTICE "%s: Warning: Device %s is misaligned\n",
629629
top, bottom);
630630
}
631+
632+
t->backing_dev_info->io_pages =
633+
t->limits.max_sectors >> (PAGE_SHIFT - 9);
631634
}
632635
EXPORT_SYMBOL(disk_stack_limits);
633636

‎block/blk-zoned.c‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,38 @@
2020

2121
#include "blk.h"
2222

23+
#define ZONE_COND_NAME(name) [BLK_ZONE_COND_##name] = #name
24+
static const char *const zone_cond_name[] = {
25+
ZONE_COND_NAME(NOT_WP),
26+
ZONE_COND_NAME(EMPTY),
27+
ZONE_COND_NAME(IMP_OPEN),
28+
ZONE_COND_NAME(EXP_OPEN),
29+
ZONE_COND_NAME(CLOSED),
30+
ZONE_COND_NAME(READONLY),
31+
ZONE_COND_NAME(FULL),
32+
ZONE_COND_NAME(OFFLINE),
33+
};
34+
#undef ZONE_COND_NAME
35+
36+
/**
37+
* blk_zone_cond_str - Return string XXX in BLK_ZONE_COND_XXX.
38+
* @zone_cond: BLK_ZONE_COND_XXX.
39+
*
40+
* Description: Centralize block layer function to convert BLK_ZONE_COND_XXX
41+
* into string format. Useful in the debugging and tracing zone conditions. For
42+
* invalid BLK_ZONE_COND_XXX it returns string "UNKNOWN".
43+
*/
44+
const char *blk_zone_cond_str(enum blk_zone_cond zone_cond)
45+
{
46+
static const char *zone_cond_str = "UNKNOWN";
47+
48+
if (zone_cond < ARRAY_SIZE(zone_cond_name) && zone_cond_name[zone_cond])
49+
zone_cond_str = zone_cond_name[zone_cond];
50+
51+
return zone_cond_str;
52+
}
53+
EXPORT_SYMBOL_GPL(blk_zone_cond_str);
54+
2355
static inline sector_t blk_zone_start(struct request_queue *q,
2456
sector_t sector)
2557
{

‎drivers/block/Makefile‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
# Rewritten to use lists instead of if-statements.
77
#
88

9+
# needed for trace events
10+
ccflags-y += -I$(src)
11+
912
obj-$(CONFIG_MAC_FLOPPY) += swim3.o
1013
obj-$(CONFIG_BLK_DEV_SWIM) += swim_mod.o
1114
obj-$(CONFIG_BLK_DEV_FD) += floppy.o
@@ -39,6 +42,9 @@ obj-$(CONFIG_ZRAM) += zram/
3942

4043
obj-$(CONFIG_BLK_DEV_NULL_BLK) += null_blk.o
4144
null_blk-objs := null_blk_main.o
45+
ifeq ($(CONFIG_BLK_DEV_ZONED), y)
46+
null_blk-$(CONFIG_TRACING) += null_blk_trace.o
47+
endif
4248
null_blk-$(CONFIG_BLK_DEV_ZONED) += null_blk_zoned.o
4349

4450
skd-y := skd_main.o

‎drivers/block/aoe/aoeblk.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ static ssize_t aoedisk_show_netif(struct device *dev,
8787
if (*nd == NULL)
8888
return snprintf(page, PAGE_SIZE, "none\n");
8989
for (p = page; nd < ne; nd++)
90-
p += snprintf(p, PAGE_SIZE - (p-page), "%s%s",
90+
p += scnprintf(p, PAGE_SIZE - (p-page), "%s%s",
9191
p == page ? "" : ",", (*nd)->name);
92-
p += snprintf(p, PAGE_SIZE - (p-page), "\n");
92+
p += scnprintf(p, PAGE_SIZE - (p-page), "\n");
9393
return p-page;
9494
}
9595
/* firmware version */

‎drivers/block/drbd/drbd_main.c‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,22 +3413,11 @@ int drbd_md_read(struct drbd_device *device, struct drbd_backing_dev *bdev)
34133413
* the meta-data super block. This function sets MD_DIRTY, and starts a
34143414
* timer that ensures that within five seconds you have to call drbd_md_sync().
34153415
*/
3416-
#ifdef DEBUG
3417-
void drbd_md_mark_dirty_(struct drbd_device *device, unsigned int line, const char *func)
3418-
{
3419-
if (!test_and_set_bit(MD_DIRTY, &device->flags)) {
3420-
mod_timer(&device->md_sync_timer, jiffies + HZ);
3421-
device->last_md_mark_dirty.line = line;
3422-
device->last_md_mark_dirty.func = func;
3423-
}
3424-
}
3425-
#else
34263416
void drbd_md_mark_dirty(struct drbd_device *device)
34273417
{
34283418
if (!test_and_set_bit(MD_DIRTY, &device->flags))
34293419
mod_timer(&device->md_sync_timer, jiffies + 5*HZ);
34303420
}
3431-
#endif
34323421

34333422
void drbd_uuid_move_history(struct drbd_device *device) __must_hold(local)
34343423
{

0 commit comments

Comments
 (0)