Skip to content

Commit 7eb7f57

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley: "Usual driver updates (ufs, lpfc, target, qla2xxx) plus assorted cleanups and fixes including the WQ_PERCPU series. The biggest core change is the new allocation of pseudo-devices which allow the sending of internal commands to a given SCSI target" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (147 commits) scsi: MAINTAINERS: Add the UFS include directory scsi: scsi_debug: Support injecting unaligned write errors scsi: qla2xxx: Fix improper freeing of purex item scsi: ufs: rockchip: Fix compile error without CONFIG_GPIOLIB scsi: ufs: rockchip: Reset controller on PRE_CHANGE of hce enable notify scsi: ufs: core: Use scsi_device_busy() scsi: ufs: core: Fix single doorbell mode support scsi: pm80xx: Add WQ_PERCPU to alloc_workqueue() users scsi: target: Add WQ_PERCPU to alloc_workqueue() users scsi: qedi: Add WQ_PERCPU to alloc_workqueue() users scsi: target: ibmvscsi: Add WQ_PERCPU to alloc_workqueue() users scsi: qedf: Add WQ_PERCPU to alloc_workqueue() users scsi: bnx2fc: Add WQ_PERCPU to alloc_workqueue() users scsi: be2iscsi: Add WQ_PERCPU to alloc_workqueue() users scsi: message: fusion: Add WQ_PERCPU to alloc_workqueue() users scsi: lpfc: WQ_PERCPU added to alloc_workqueue() users scsi: scsi_transport_fc: WQ_PERCPU added to alloc_workqueue users() scsi: scsi_dh_alua: WQ_PERCPU added to alloc_workqueue() users scsi: qla2xxx: WQ_PERCPU added to alloc_workqueue() users scsi: target: sbp: Replace use of system_unbound_wq with system_dfl_wq ...
2 parents 3af870a + 82f78ac commit 7eb7f57

115 files changed

Lines changed: 4936 additions & 1457 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/devicetree/bindings/phy/mediatek,ufs-phy.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
88
title: MediaTek Universal Flash Storage (UFS) M-PHY
99

1010
maintainers:
11-
- Stanley Chu <stanley.chu@mediatek.com>
1211
- Chunfeng Yun <chunfeng.yun@mediatek.com>
12+
- Peter Wang <peter.wang@mediatek.com>
13+
- Chaotian Jing <chaotian.jing@mediatek.com>
1314

1415
description: |
1516
UFS M-PHY nodes are defined to describe on-chip UFS M-PHY hardware macro.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/ufs/amd,versal2-ufs.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: AMD Versal Gen 2 UFS Host Controller
8+
9+
maintainers:
10+
- Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>
11+
12+
allOf:
13+
- $ref: ufs-common.yaml
14+
15+
properties:
16+
compatible:
17+
const: amd,versal2-ufs
18+
19+
reg:
20+
maxItems: 1
21+
22+
clocks:
23+
maxItems: 1
24+
25+
clock-names:
26+
items:
27+
- const: core
28+
29+
power-domains:
30+
maxItems: 1
31+
32+
resets:
33+
maxItems: 2
34+
35+
reset-names:
36+
items:
37+
- const: host
38+
- const: phy
39+
40+
required:
41+
- reg
42+
- clocks
43+
- clock-names
44+
- resets
45+
- reset-names
46+
47+
unevaluatedProperties: false
48+
49+
examples:
50+
- |
51+
#include <dt-bindings/interrupt-controller/arm-gic.h>
52+
ufs@f10b0000 {
53+
compatible = "amd,versal2-ufs";
54+
reg = <0xf10b0000 0x1000>;
55+
clocks = <&ufs_core_clk>;
56+
clock-names = "core";
57+
resets = <&scmi_reset 4>, <&scmi_reset 35>;
58+
reset-names = "host", "phy";
59+
interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH>;
60+
freq-table-hz = <0 0>;
61+
};

Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
77
title: Mediatek Universal Flash Storage (UFS) Controller
88

99
maintainers:
10-
- Stanley Chu <stanley.chu@mediatek.com>
10+
- Peter Wang <peter.wang@mediatek.com>
11+
- Chaotian Jing <chaotian.jing@mediatek.com>
1112

1213
properties:
1314
compatible:

Documentation/devicetree/bindings/ufs/qcom,ufs.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ allOf:
8888
- const: ice_core_clk
8989
reg:
9090
minItems: 2
91-
maxItems: 2
9291
reg-names:
9392
minItems: 2
9493
required:
@@ -117,7 +116,6 @@ allOf:
117116
- const: tx_lane0_sync_clk
118117
- const: rx_lane0_sync_clk
119118
reg:
120-
minItems: 1
121119
maxItems: 1
122120
reg-names:
123121
maxItems: 1
@@ -147,7 +145,6 @@ allOf:
147145
- const: ice_core_clk
148146
reg:
149147
minItems: 2
150-
maxItems: 2
151148
reg-names:
152149
minItems: 2
153150
required:

Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ properties:
6161
phy-names:
6262
const: ufs-phy
6363

64+
power-domains:
65+
maxItems: 1
66+
6467
samsung,sysreg:
6568
$ref: /schemas/types.yaml#/definitions/phandle-array
6669
items:

MAINTAINERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23313,6 +23313,7 @@ F: drivers/scsi/
2331323313
F: drivers/ufs/
2331423314
F: include/scsi/
2331523315
F: include/uapi/scsi/
23316+
F: include/ufs/
2331623317

2331723318
SCSI TAPE DRIVER
2331823319
M: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
@@ -26628,6 +26629,14 @@ S: Supported
2662826629
F: Documentation/devicetree/bindings/ufs/
2662926630
F: Documentation/scsi/ufs.rst
2663026631
F: drivers/ufs/core/
26632+
F: include/ufs/
26633+
26634+
UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER AMD VERSAL2
26635+
M: Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>
26636+
M: Ajay Neeli <ajay.neeli@amd.com>
26637+
S: Maintained
26638+
F: Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml
26639+
F: drivers/ufs/host/ufs-amd-versal2.c
2663126640

2663226641
UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER DWC HOOKS
2663326642
M: Pedro Sousa <pedrom.sousa@synopsys.com>
@@ -26645,6 +26654,7 @@ F: drivers/ufs/host/ufs-exynos*
2664526654

2664626655
UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER MEDIATEK HOOKS
2664726656
M: Peter Wang <peter.wang@mediatek.com>
26657+
M: Chaotian Jing <chaotian.jing@mediatek.com>
2664826658
R: Stanley Jhu <chu.stanley@gmail.com>
2664926659
L: linux-scsi@vger.kernel.org
2665026660
L: linux-mediatek@lists.infradead.org (moderated for non-subscribers)

drivers/ata/libata-acpi.c

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,73 @@ void ata_acpi_bind_dev(struct ata_device *dev)
245245
ata_acpi_dev_uevent);
246246
}
247247

248+
/**
249+
* ata_acpi_dev_manage_restart - if the disk should be stopped (spun down) on
250+
* system restart.
251+
* @dev: target ATA device
252+
*
253+
* RETURNS:
254+
* true if the disk should be stopped, otherwise false.
255+
*/
256+
bool ata_acpi_dev_manage_restart(struct ata_device *dev)
257+
{
258+
struct device *tdev;
259+
260+
/*
261+
* If ATA_FLAG_ACPI_SATA is set, the acpi fwnode is attached to the
262+
* ata_device instead of the ata_port.
263+
*/
264+
if (dev->link->ap->flags & ATA_FLAG_ACPI_SATA)
265+
tdev = &dev->tdev;
266+
else
267+
tdev = &dev->link->ap->tdev;
268+
269+
if (!is_acpi_device_node(tdev->fwnode))
270+
return false;
271+
return acpi_bus_power_manageable(ACPI_HANDLE(tdev));
272+
}
273+
274+
/**
275+
* ata_acpi_port_power_on - set the power state of the ata port to D0
276+
* @ap: target ATA port
277+
*
278+
* This function is called at the beginning of ata_port_probe().
279+
*/
280+
void ata_acpi_port_power_on(struct ata_port *ap)
281+
{
282+
acpi_handle handle;
283+
int i;
284+
285+
/*
286+
* If ATA_FLAG_ACPI_SATA is set, the acpi fwnode is attached to the
287+
* ata_device instead of the ata_port.
288+
*/
289+
if (ap->flags & ATA_FLAG_ACPI_SATA) {
290+
for (i = 0; i < ATA_MAX_DEVICES; i++) {
291+
struct ata_device *dev = &ap->link.device[i];
292+
293+
if (!is_acpi_device_node(dev->tdev.fwnode))
294+
continue;
295+
handle = ACPI_HANDLE(&dev->tdev);
296+
if (!acpi_bus_power_manageable(handle))
297+
continue;
298+
if (acpi_bus_set_power(handle, ACPI_STATE_D0))
299+
ata_dev_err(dev,
300+
"acpi: failed to set power state to D0\n");
301+
}
302+
return;
303+
}
304+
305+
if (!is_acpi_device_node(ap->tdev.fwnode))
306+
return;
307+
handle = ACPI_HANDLE(&ap->tdev);
308+
if (!acpi_bus_power_manageable(handle))
309+
return;
310+
311+
if (acpi_bus_set_power(handle, ACPI_STATE_D0))
312+
ata_port_err(ap, "acpi: failed to set power state to D0\n");
313+
}
314+
248315
/**
249316
* ata_acpi_dissociate - dissociate ATA host from ACPI objects
250317
* @host: target ATA host

drivers/ata/libata-core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5915,6 +5915,8 @@ void ata_port_probe(struct ata_port *ap)
59155915
struct ata_eh_info *ehi = &ap->link.eh_info;
59165916
unsigned long flags;
59175917

5918+
ata_acpi_port_power_on(ap);
5919+
59185920
/* kick EH for boot probing */
59195921
spin_lock_irqsave(ap->lock, flags);
59205922

drivers/ata/libata-scsi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,7 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct queue_limits *lim,
11021102
*/
11031103
sdev->manage_runtime_start_stop = 1;
11041104
sdev->manage_shutdown = 1;
1105+
sdev->manage_restart = ata_acpi_dev_manage_restart(dev);
11051106
sdev->force_runtime_start_on_system_start = 1;
11061107
}
11071108

drivers/ata/libata.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ extern void ata_acpi_on_disable(struct ata_device *dev);
130130
extern void ata_acpi_set_state(struct ata_port *ap, pm_message_t state);
131131
extern void ata_acpi_bind_port(struct ata_port *ap);
132132
extern void ata_acpi_bind_dev(struct ata_device *dev);
133+
extern void ata_acpi_port_power_on(struct ata_port *ap);
134+
extern bool ata_acpi_dev_manage_restart(struct ata_device *dev);
133135
extern acpi_handle ata_dev_acpi_handle(struct ata_device *dev);
134136
#else
135137
static inline void ata_acpi_dissociate(struct ata_host *host) { }
@@ -140,6 +142,8 @@ static inline void ata_acpi_set_state(struct ata_port *ap,
140142
pm_message_t state) { }
141143
static inline void ata_acpi_bind_port(struct ata_port *ap) {}
142144
static inline void ata_acpi_bind_dev(struct ata_device *dev) {}
145+
static inline void ata_acpi_port_power_on(struct ata_port *ap) {}
146+
static inline bool ata_acpi_dev_manage_restart(struct ata_device *dev) { return 0; }
143147
#endif
144148

145149
/* libata-scsi.c */

0 commit comments

Comments
 (0)