Skip to content

Commit

Permalink
Merge tag 'for-5.7/drivers-2020-03-29' of git://git.kernel.dk/linux-b…
Browse files Browse the repository at this point in the history
…lock

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
  ...
  • Loading branch information
torvalds committed Mar 30, 2020
2 parents 10f36b1 + 766c329 commit 1592614
Show file tree
Hide file tree
Showing 39 changed files with 1,774 additions and 976 deletions.
88 changes: 13 additions & 75 deletions arch/arm/include/asm/floppy.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@
*/
#ifndef __ASM_ARM_FLOPPY_H
#define __ASM_ARM_FLOPPY_H
#if 0
#include <mach/floppy.h>
#endif

#define fd_outb(val,port) \
do { \
if ((port) == (u32)FD_DOR) \
fd_setdor((val)); \
else \
outb((val),(port)); \
#define fd_outb(val,port) \
do { \
int new_val = (val); \
if (((port) & 7) == FD_DOR) { \
if (new_val & 0xf0) \
new_val = (new_val & 0x0c) | \
floppy_selects[new_val & 3]; \
else \
new_val &= 0x0c; \
} \
outb(new_val, (port)); \
} while(0)

#define fd_inb(port) inb((port))
Expand Down Expand Up @@ -53,69 +55,7 @@ static inline int fd_dma_setup(void *data, unsigned int length,
* to a non-zero track, and then restoring it to track 0. If an error occurs,
* then there is no floppy drive present. [to be put back in again]
*/
static unsigned char floppy_selects[2][4] =
{
{ 0x10, 0x21, 0x23, 0x33 },
{ 0x10, 0x21, 0x23, 0x33 }
};

#define fd_setdor(dor) \
do { \
int new_dor = (dor); \
if (new_dor & 0xf0) \
new_dor = (new_dor & 0x0c) | floppy_selects[fdc][new_dor & 3]; \
else \
new_dor &= 0x0c; \
outb(new_dor, FD_DOR); \
} while (0)

/*
* Someday, we'll automatically detect which drives are present...
*/
static inline void fd_scandrives (void)
{
#if 0
int floppy, drive_count;

fd_disable_irq();
raw_cmd = &default_raw_cmd;
raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_SEEK;
raw_cmd->track = 0;
raw_cmd->rate = ?;
drive_count = 0;
for (floppy = 0; floppy < 4; floppy ++) {
current_drive = drive_count;
/*
* Turn on floppy motor
*/
if (start_motor(redo_fd_request))
continue;
/*
* Set up FDC
*/
fdc_specify();
/*
* Tell FDC to recalibrate
*/
output_byte(FD_RECALIBRATE);
LAST_OUT(UNIT(floppy));
/* wait for command to complete */
if (!successful) {
int i;
for (i = drive_count; i < 3; i--)
floppy_selects[fdc][i] = floppy_selects[fdc][i + 1];
floppy_selects[fdc][3] = 0;
floppy -= 1;
} else
drive_count++;
}
#else
floppy_selects[0][0] = 0x10;
floppy_selects[0][1] = 0x21;
floppy_selects[0][2] = 0x23;
floppy_selects[0][3] = 0x33;
#endif
}
static unsigned char floppy_selects[4] = { 0x10, 0x21, 0x23, 0x33 };

#define FDC1 (0x3f0)

Expand All @@ -135,9 +75,7 @@ static inline void fd_scandrives (void)
*/
static void driveswap(int *ints, int dummy, int dummy2)
{
floppy_selects[0][0] ^= floppy_selects[0][1];
floppy_selects[0][1] ^= floppy_selects[0][0];
floppy_selects[0][0] ^= floppy_selects[0][1];
swap(floppy_selects[0], floppy_selects[1]);
}

#define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 }
Expand Down
3 changes: 3 additions & 0 deletions block/blk-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,9 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
printk(KERN_NOTICE "%s: Warning: Device %s is misaligned\n",
top, bottom);
}

t->backing_dev_info->io_pages =
t->limits.max_sectors >> (PAGE_SHIFT - 9);
}
EXPORT_SYMBOL(disk_stack_limits);

Expand Down
32 changes: 32 additions & 0 deletions block/blk-zoned.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,38 @@

#include "blk.h"

#define ZONE_COND_NAME(name) [BLK_ZONE_COND_##name] = #name
static const char *const zone_cond_name[] = {
ZONE_COND_NAME(NOT_WP),
ZONE_COND_NAME(EMPTY),
ZONE_COND_NAME(IMP_OPEN),
ZONE_COND_NAME(EXP_OPEN),
ZONE_COND_NAME(CLOSED),
ZONE_COND_NAME(READONLY),
ZONE_COND_NAME(FULL),
ZONE_COND_NAME(OFFLINE),
};
#undef ZONE_COND_NAME

/**
* blk_zone_cond_str - Return string XXX in BLK_ZONE_COND_XXX.
* @zone_cond: BLK_ZONE_COND_XXX.
*
* Description: Centralize block layer function to convert BLK_ZONE_COND_XXX
* into string format. Useful in the debugging and tracing zone conditions. For
* invalid BLK_ZONE_COND_XXX it returns string "UNKNOWN".
*/
const char *blk_zone_cond_str(enum blk_zone_cond zone_cond)
{
static const char *zone_cond_str = "UNKNOWN";

if (zone_cond < ARRAY_SIZE(zone_cond_name) && zone_cond_name[zone_cond])
zone_cond_str = zone_cond_name[zone_cond];

return zone_cond_str;
}
EXPORT_SYMBOL_GPL(blk_zone_cond_str);

static inline sector_t blk_zone_start(struct request_queue *q,
sector_t sector)
{
Expand Down
6 changes: 6 additions & 0 deletions drivers/block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# Rewritten to use lists instead of if-statements.
#

# needed for trace events
ccflags-y += -I$(src)

obj-$(CONFIG_MAC_FLOPPY) += swim3.o
obj-$(CONFIG_BLK_DEV_SWIM) += swim_mod.o
obj-$(CONFIG_BLK_DEV_FD) += floppy.o
Expand Down Expand Up @@ -39,6 +42,9 @@ obj-$(CONFIG_ZRAM) += zram/

obj-$(CONFIG_BLK_DEV_NULL_BLK) += null_blk.o
null_blk-objs := null_blk_main.o
ifeq ($(CONFIG_BLK_DEV_ZONED), y)
null_blk-$(CONFIG_TRACING) += null_blk_trace.o
endif
null_blk-$(CONFIG_BLK_DEV_ZONED) += null_blk_zoned.o

skd-y := skd_main.o
Expand Down
4 changes: 2 additions & 2 deletions drivers/block/aoe/aoeblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ static ssize_t aoedisk_show_netif(struct device *dev,
if (*nd == NULL)
return snprintf(page, PAGE_SIZE, "none\n");
for (p = page; nd < ne; nd++)
p += snprintf(p, PAGE_SIZE - (p-page), "%s%s",
p += scnprintf(p, PAGE_SIZE - (p-page), "%s%s",
p == page ? "" : ",", (*nd)->name);
p += snprintf(p, PAGE_SIZE - (p-page), "\n");
p += scnprintf(p, PAGE_SIZE - (p-page), "\n");
return p-page;
}
/* firmware version */
Expand Down
11 changes: 0 additions & 11 deletions drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3413,22 +3413,11 @@ int drbd_md_read(struct drbd_device *device, struct drbd_backing_dev *bdev)
* the meta-data super block. This function sets MD_DIRTY, and starts a
* timer that ensures that within five seconds you have to call drbd_md_sync().
*/
#ifdef DEBUG
void drbd_md_mark_dirty_(struct drbd_device *device, unsigned int line, const char *func)
{
if (!test_and_set_bit(MD_DIRTY, &device->flags)) {
mod_timer(&device->md_sync_timer, jiffies + HZ);
device->last_md_mark_dirty.line = line;
device->last_md_mark_dirty.func = func;
}
}
#else
void drbd_md_mark_dirty(struct drbd_device *device)
{
if (!test_and_set_bit(MD_DIRTY, &device->flags))
mod_timer(&device->md_sync_timer, jiffies + 5*HZ);
}
#endif

void drbd_uuid_move_history(struct drbd_device *device) __must_hold(local)
{
Expand Down
Loading

0 comments on commit 1592614

Please sign in to comment.