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

Merge tag 'for-5.14/drivers-2021-06-29' of git://git.kernel.dk/linux-block

Pull block driver updates from Jens Axboe:
 "Pretty calm round, mostly just NVMe and a bit of MD:

   - NVMe updates (via Christoph)
        - improve the APST configuration algorithm (Alexey Bogoslavsky)
        - look for StorageD3Enable on companion ACPI device
          (Mario Limonciello)
        - allow selecting the network interface for TCP connections
          (Martin Belanger)
        - misc cleanups (Amit Engel, Chaitanya Kulkarni, Colin Ian King,
          Christoph)
        - move the ACPI StorageD3 code to drivers/acpi/ and add quirks
          for certain AMD CPUs (Mario Limonciello)
        - zoned device support for nvmet (Chaitanya Kulkarni)
        - fix the rules for changing the serial number in nvmet
          (Noam Gottlieb)
        - various small fixes and cleanups (Dan Carpenter, JK Kim,
          Chaitanya Kulkarni, Hannes Reinecke, Wesley Sheng, Geert
          Uytterhoeven, Daniel Wagner)

   - MD updates (Via Song)
        - iostats rewrite (Guoqing Jiang)
        - raid5 lock contention optimization (Gal Ofri)

   - Fall through warning fix (Gustavo)

   - Misc fixes (Gustavo, Jiapeng)"

* tag 'for-5.14/drivers-2021-06-29' of git://git.kernel.dk/linux-block: (78 commits)
  nvmet: use NVMET_MAX_NAMESPACES to set nn value
  loop: Fix missing discard support when using LOOP_CONFIGURE
  nvme.h: add missing nvme_lba_range_type endianness annotations
  nvme: remove zeroout memset call for struct
  nvme-pci: remove zeroout memset call for struct
  nvmet: remove zeroout memset call for struct
  nvmet: add ZBD over ZNS backend support
  nvmet: add Command Set Identifier support
  nvmet: add nvmet_req_bio put helper for backends
  nvmet: add req cns error complete helper
  block: export blk_next_bio()
  nvmet: remove local variable
  nvmet: use nvme status value directly
  nvmet: use u32 type for the local variable nsid
  nvmet: use u32 for nvmet_subsys max_nsid
  nvmet: use req->cmd directly in file-ns fast path
  nvmet: use req->cmd directly in bdev-ns fast path
  nvmet: make ver stable once connection established
  nvmet: allow mn change if subsys not discovered
  nvmet: make sn stable once connection was established
  ...
parents df668a5f 5ed9b357
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ struct bio *blk_next_bio(struct bio *bio, unsigned int nr_pages, gfp_t gfp)

	return new;
}
EXPORT_SYMBOL_GPL(blk_next_bio);

int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
		sector_t nr_sects, gfp_t gfp_mask, int flags,
+32 −0
Original line number Diff line number Diff line
@@ -1368,4 +1368,36 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
	return 1;
}
EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);

/**
 * acpi_storage_d3 - Check if D3 should be used in the suspend path
 * @dev: Device to check
 *
 * Return %true if the platform firmware wants @dev to be programmed
 * into D3hot or D3cold (if supported) in the suspend path, or %false
 * when there is no specific preference. On some platforms, if this
 * hint is ignored, @dev may remain unresponsive after suspending the
 * platform as a whole.
 *
 * Although the property has storage in the name it actually is
 * applied to the PCIe slot and plugging in a non-storage device the
 * same platform restrictions will likely apply.
 */
bool acpi_storage_d3(struct device *dev)
{
	struct acpi_device *adev = ACPI_COMPANION(dev);
	u8 val;

	if (force_storage_d3())
		return true;

	if (!adev)
		return false;
	if (fwnode_property_read_u8(acpi_fwnode_handle(adev), "StorageD3Enable",
			&val))
		return false;
	return val == 1;
}
EXPORT_SYMBOL_GPL(acpi_storage_d3);

#endif /* CONFIG_PM */
+9 −0
Original line number Diff line number Diff line
@@ -234,6 +234,15 @@ static inline int suspend_nvs_save(void) { return 0; }
static inline void suspend_nvs_restore(void) {}
#endif

#ifdef CONFIG_X86
bool force_storage_d3(void);
#else
static inline bool force_storage_d3(void)
{
	return false;
}
#endif

/*--------------------------------------------------------------------------
				Device properties
  -------------------------------------------------------------------------- */
+25 −0
Original line number Diff line number Diff line
@@ -135,3 +135,28 @@ bool acpi_device_always_present(struct acpi_device *adev)

	return ret;
}

/*
 * AMD systems from Renoir and Lucienne *require* that the NVME controller
 * is put into D3 over a Modern Standby / suspend-to-idle cycle.
 *
 * This is "typically" accomplished using the `StorageD3Enable`
 * property in the _DSD that is checked via the `acpi_storage_d3` function
 * but this property was introduced after many of these systems launched
 * and most OEM systems don't have it in their BIOS.
 *
 * The Microsoft documentation for StorageD3Enable mentioned that Windows has
 * a hardcoded allowlist for D3 support, which was used for these platforms.
 *
 * This allows quirking on Linux in a similar fashion.
 */
static const struct x86_cpu_id storage_d3_cpu_ids[] = {
	X86_MATCH_VENDOR_FAM_MODEL(AMD, 23, 96, NULL),	/* Renoir */
	X86_MATCH_VENDOR_FAM_MODEL(AMD, 23, 104, NULL),	/* Lucienne */
	{}
};

bool force_storage_d3(void)
{
	return x86_match_cpu(storage_d3_cpu_ids);
}
+1 −3
Original line number Diff line number Diff line
@@ -140,10 +140,8 @@ bail: spin_unlock_irqrestore(&emsgs_lock, flags);
	}

	mp = kmemdup(msg, n, GFP_ATOMIC);
	if (mp == NULL) {
		printk(KERN_ERR "aoe: allocation failure, len=%ld\n", n);
	if (!mp)
		goto bail;
	}

	em->msg = mp;
	em->flags |= EMFL_VALID;
Loading