Commit 15926148 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
  ...
parents 10f36b1e 766c3297
Loading
Loading
Loading
Loading
+13 −75
Original line number Diff line number Diff line
@@ -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));	\
		int new_val = (val);					\
		if (((port) & 7) == FD_DOR) {				\
			if (new_val & 0xf0)				\
				new_val = (new_val & 0x0c) |		\
					  floppy_selects[new_val & 3];	\
			else						\
			outb((val),(port));	\
				new_val &= 0x0c;			\
		}							\
		outb(new_val, (port));					\
	} while(0)

#define fd_inb(port)		inb((port))
@@ -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)

@@ -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 }
+3 −0
Original line number Diff line number Diff line
@@ -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);

+32 −0
Original line number Diff line number Diff line
@@ -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)
{
+6 −0
Original line number Diff line number Diff line
@@ -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
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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 */
Loading