Skip to content

Commit d7edcc7

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull more SCSI updates from James Bottomley: "This is mostly fixes and cleanups and code reworks that trickled in across the merge window and the weeks leading up. The only substantive update is the Mediatek ufs driver which accounts for the bulk of the additions" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (37 commits) scsi: libsas: Use a bool for sas_deform_port() second argument scsi: libsas: Move declarations of internal functions to sas_internal.h scsi: libsas: Make sas_get_ata_info() static scsi: libsas: Simplify sas_ata_wait_eh() scsi: libsas: Refactor dev_is_sata() scsi: sd: Make sd shutdown issue START STOP UNIT appropriately scsi: arm64: dts: mediatek: mt8195: Add UFSHCI node scsi: dt-bindings: mediatek,ufs: add MT8195 compatible and update clock nodes scsi: dt-bindings: mediatek,ufs: Add ufs-disable-mcq flag for UFS host scsi: ufs: ufs-mediatek: Add UFS host support for MT8195 SoC scsi: ufs: ufs-pci: Remove control of UIC Completion interrupt for Intel MTL scsi: ufs: core: Do not write interrupt enable register unnecessarily scsi: ufs: core: Set and clear UIC Completion interrupt as needed scsi: ufs: core: Remove duplicated code in ufshcd_send_bsg_uic_cmd() scsi: ufs: core: Move ufshcd_enable_intr() and ufshcd_disable_intr() scsi: ufs: ufs-pci: Remove UFS PCI driver's ->late_init() call back scsi: ufs: ufs-pci: Fix default runtime and system PM levels scsi: ufs: ufs-pci: Fix hibernate state transition for Intel MTL-like host controllers scsi: ufs: host: mediatek: Support FDE (AES) clock scaling scsi: ufs: host: mediatek: Support clock scaling with Vcore binding ...
2 parents 4790580 + 7038db7 commit d7edcc7

26 files changed

+701
-276
lines changed

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

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@ title: Mediatek Universal Flash Storage (UFS) Controller
99
maintainers:
1010
- Stanley Chu <[email protected]>
1111

12-
allOf:
13-
- $ref: ufs-common.yaml
14-
1512
properties:
1613
compatible:
1714
enum:
1815
- mediatek,mt8183-ufshci
1916
- mediatek,mt8192-ufshci
17+
- mediatek,mt8195-ufshci
2018

2119
clocks:
22-
maxItems: 1
20+
minItems: 1
21+
maxItems: 8
2322

2423
clock-names:
25-
items:
26-
- const: ufs
24+
minItems: 1
25+
maxItems: 8
2726

2827
phys:
2928
maxItems: 1
@@ -33,6 +32,10 @@ properties:
3332

3433
vcc-supply: true
3534

35+
mediatek,ufs-disable-mcq:
36+
$ref: /schemas/types.yaml#/definitions/flag
37+
description: The mask to disable MCQ (Multi-Circular Queue) for UFS host.
38+
3639
required:
3740
- compatible
3841
- clocks
@@ -43,6 +46,37 @@ required:
4346

4447
unevaluatedProperties: false
4548

49+
allOf:
50+
- $ref: ufs-common.yaml
51+
52+
- if:
53+
properties:
54+
compatible:
55+
contains:
56+
enum:
57+
- mediatek,mt8195-ufshci
58+
then:
59+
properties:
60+
clocks:
61+
minItems: 8
62+
clock-names:
63+
items:
64+
- const: ufs
65+
- const: ufs_aes
66+
- const: ufs_tick
67+
- const: unipro_sysclk
68+
- const: unipro_tick
69+
- const: unipro_mp_bclk
70+
- const: ufs_tx_symbol
71+
- const: ufs_mem_sub
72+
else:
73+
properties:
74+
clocks:
75+
maxItems: 1
76+
clock-names:
77+
items:
78+
- const: ufs
79+
4680
examples:
4781
- |
4882
#include <dt-bindings/clock/mt8183-clk.h>

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11100,7 +11100,7 @@ F: Documentation/devicetree/bindings/infiniband/hisilicon-hns-roce.txt
1110011100
F: drivers/infiniband/hw/hns/
1110111101

1110211102
HISILICON SAS Controller
11103-
M: Yihang Li <liyihang9@huawei.com>
11103+
M: Yihang Li <liyihang9@h-partners.com>
1110411104
S: Supported
1110511105
W: http://www.hisilicon.com
1110611106
F: Documentation/devicetree/bindings/scsi/hisilicon-sas.txt

arch/arm64/boot/dts/mediatek/mt8195.dtsi

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,31 @@
14301430
status = "disabled";
14311431
};
14321432

1433+
ufshci: ufshci@11270000 {
1434+
compatible = "mediatek,mt8195-ufshci";
1435+
reg = <0 0x11270000 0 0x2300>;
1436+
interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH 0>;
1437+
phys = <&ufsphy>;
1438+
clocks = <&infracfg_ao CLK_INFRA_AO_AES_UFSFDE>,
1439+
<&infracfg_ao CLK_INFRA_AO_AES>,
1440+
<&infracfg_ao CLK_INFRA_AO_UFS_TICK>,
1441+
<&infracfg_ao CLK_INFRA_AO_UNIPRO_SYS>,
1442+
<&infracfg_ao CLK_INFRA_AO_UNIPRO_TICK>,
1443+
<&infracfg_ao CLK_INFRA_AO_UFS_MP_SAP_B>,
1444+
<&infracfg_ao CLK_INFRA_AO_UFS_TX_SYMBOL>,
1445+
<&infracfg_ao CLK_INFRA_AO_PERI_UFS_MEM_SUB>;
1446+
clock-names = "ufs", "ufs_aes", "ufs_tick",
1447+
"unipro_sysclk", "unipro_tick",
1448+
"unipro_mp_bclk", "ufs_tx_symbol",
1449+
"ufs_mem_sub";
1450+
freq-table-hz = <0 0>, <0 0>, <0 0>,
1451+
<0 0>, <0 0>, <0 0>,
1452+
<0 0>, <0 0>;
1453+
1454+
mediatek,ufs-disable-mcq;
1455+
status = "disabled";
1456+
};
1457+
14331458
lvts_mcu: thermal-sensor@11278000 {
14341459
compatible = "mediatek,mt8195-lvts-mcu";
14351460
reg = <0 0x11278000 0 0x1000>;

drivers/scsi/aacraid/comminit.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,7 @@ void aac_define_int_mode(struct aac_dev *dev)
481481
pci_find_capability(dev->pdev, PCI_CAP_ID_MSIX)) {
482482
min_msix = 2;
483483
i = pci_alloc_irq_vectors(dev->pdev,
484-
min_msix, msi_count,
485-
PCI_IRQ_MSIX | PCI_IRQ_AFFINITY);
484+
min_msix, msi_count, PCI_IRQ_MSIX);
486485
if (i > 0) {
487486
dev->msi_enabled = 1;
488487
msi_count = i;

drivers/scsi/libsas/sas_ata.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static int sas_get_ata_command_set(struct domain_device *dev)
252252
return ata_dev_classify(&tf);
253253
}
254254

255-
int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy)
255+
static int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy)
256256
{
257257
if (phy->attached_tproto & SAS_PROTOCOL_STP)
258258
dev->tproto = phy->attached_tproto;
@@ -927,13 +927,7 @@ EXPORT_SYMBOL_GPL(sas_ata_schedule_reset);
927927

928928
void sas_ata_wait_eh(struct domain_device *dev)
929929
{
930-
struct ata_port *ap;
931-
932-
if (!dev_is_sata(dev))
933-
return;
934-
935-
ap = dev->sata_dev.ap;
936-
ata_port_wait_eh(ap);
930+
ata_port_wait_eh(dev->sata_dev.ap);
937931
}
938932

939933
void sas_ata_device_link_abort(struct domain_device *device, bool force_reset)

drivers/scsi/libsas/sas_discover.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev)
406406
}
407407
}
408408

409-
void sas_unregister_domain_devices(struct asd_sas_port *port, int gone)
409+
void sas_unregister_domain_devices(struct asd_sas_port *port, bool gone)
410410
{
411411
struct domain_device *dev, *n;
412412

drivers/scsi/libsas/sas_internal.h

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void sas_hash_addr(u8 *hashed, const u8 *sas_addr);
4444
int sas_discover_root_expander(struct domain_device *dev);
4545

4646
int sas_ex_revalidate_domain(struct domain_device *dev);
47-
void sas_unregister_domain_devices(struct asd_sas_port *port, int gone);
47+
void sas_unregister_domain_devices(struct asd_sas_port *port, bool gone);
4848
void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *port);
4949
void sas_discover_event(struct asd_sas_port *port, enum discover_event ev);
5050

@@ -70,7 +70,7 @@ void sas_enable_revalidation(struct sas_ha_struct *ha);
7070
void sas_queue_deferred_work(struct sas_ha_struct *ha);
7171
void __sas_drain_work(struct sas_ha_struct *ha);
7272

73-
void sas_deform_port(struct asd_sas_phy *phy, int gone);
73+
void sas_deform_port(struct asd_sas_phy *phy, bool gone);
7474

7575
void sas_porte_bytes_dmaed(struct work_struct *work);
7676
void sas_porte_broadcast_rcvd(struct work_struct *work);
@@ -222,4 +222,78 @@ static inline void sas_put_device(struct domain_device *dev)
222222
kref_put(&dev->kref, sas_free_device);
223223
}
224224

225+
#ifdef CONFIG_SCSI_SAS_ATA
226+
227+
int sas_ata_init(struct domain_device *dev);
228+
void sas_ata_task_abort(struct sas_task *task);
229+
int sas_discover_sata(struct domain_device *dev);
230+
int sas_ata_add_dev(struct domain_device *parent, struct ex_phy *phy,
231+
struct domain_device *child, int phy_id);
232+
void sas_ata_strategy_handler(struct Scsi_Host *shost);
233+
void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q);
234+
void sas_ata_end_eh(struct ata_port *ap);
235+
void sas_ata_wait_eh(struct domain_device *dev);
236+
void sas_probe_sata(struct asd_sas_port *port);
237+
void sas_suspend_sata(struct asd_sas_port *port);
238+
void sas_resume_sata(struct asd_sas_port *port);
239+
240+
#else
241+
242+
static inline int sas_ata_init(struct domain_device *dev)
243+
{
244+
return 0;
245+
}
246+
247+
static inline void sas_ata_task_abort(struct sas_task *task)
248+
{
249+
}
250+
251+
static inline void sas_ata_strategy_handler(struct Scsi_Host *shost)
252+
{
253+
}
254+
255+
static inline void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q)
256+
{
257+
}
258+
259+
static inline void sas_ata_end_eh(struct ata_port *ap)
260+
{
261+
}
262+
263+
static inline void sas_ata_wait_eh(struct domain_device *dev)
264+
{
265+
}
266+
267+
static inline void sas_probe_sata(struct asd_sas_port *port)
268+
{
269+
}
270+
271+
static inline void sas_suspend_sata(struct asd_sas_port *port)
272+
{
273+
}
274+
275+
static inline void sas_resume_sata(struct asd_sas_port *port)
276+
{
277+
}
278+
279+
static inline void sas_ata_disabled_notice(void)
280+
{
281+
pr_notice_once("ATA device seen but CONFIG_SCSI_SAS_ATA=N\n");
282+
}
283+
284+
static inline int sas_discover_sata(struct domain_device *dev)
285+
{
286+
sas_ata_disabled_notice();
287+
return -ENXIO;
288+
}
289+
290+
static inline int sas_ata_add_dev(struct domain_device *parent, struct ex_phy *phy,
291+
struct domain_device *child, int phy_id)
292+
{
293+
sas_ata_disabled_notice();
294+
return -ENODEV;
295+
}
296+
297+
#endif
298+
225299
#endif /* _SAS_INTERNAL_H_ */

drivers/scsi/libsas/sas_phy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static void sas_phye_loss_of_signal(struct work_struct *work)
2020
struct asd_sas_phy *phy = ev->phy;
2121

2222
phy->error = 0;
23-
sas_deform_port(phy, 1);
23+
sas_deform_port(phy, true);
2424
}
2525

2626
static void sas_phye_oob_done(struct work_struct *work)
@@ -40,7 +40,7 @@ static void sas_phye_oob_error(struct work_struct *work)
4040
struct sas_internal *i =
4141
to_sas_internal(sas_ha->shost->transportt);
4242

43-
sas_deform_port(phy, 1);
43+
sas_deform_port(phy, true);
4444

4545
if (!port && phy->enabled && i->dft->lldd_control_phy) {
4646
phy->error++;
@@ -85,7 +85,7 @@ static void sas_phye_resume_timeout(struct work_struct *work)
8585

8686
phy->error = 0;
8787
phy->suspended = 0;
88-
sas_deform_port(phy, 1);
88+
sas_deform_port(phy, true);
8989
}
9090

9191

drivers/scsi/libsas/sas_port.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static void sas_form_port(struct asd_sas_phy *phy)
113113

114114
if (port) {
115115
if (!phy_is_wideport_member(port, phy))
116-
sas_deform_port(phy, 0);
116+
sas_deform_port(phy, false);
117117
else if (phy->suspended) {
118118
phy->suspended = 0;
119119
sas_resume_port(phy);
@@ -206,7 +206,7 @@ static void sas_form_port(struct asd_sas_phy *phy)
206206
* This is called when the physical link to the other phy has been
207207
* lost (on this phy), in Event thread context. We cannot delay here.
208208
*/
209-
void sas_deform_port(struct asd_sas_phy *phy, int gone)
209+
void sas_deform_port(struct asd_sas_phy *phy, bool gone)
210210
{
211211
struct sas_ha_struct *sas_ha = phy->ha;
212212
struct asd_sas_port *port = phy->port;
@@ -301,23 +301,23 @@ void sas_porte_link_reset_err(struct work_struct *work)
301301
struct asd_sas_event *ev = to_asd_sas_event(work);
302302
struct asd_sas_phy *phy = ev->phy;
303303

304-
sas_deform_port(phy, 1);
304+
sas_deform_port(phy, true);
305305
}
306306

307307
void sas_porte_timer_event(struct work_struct *work)
308308
{
309309
struct asd_sas_event *ev = to_asd_sas_event(work);
310310
struct asd_sas_phy *phy = ev->phy;
311311

312-
sas_deform_port(phy, 1);
312+
sas_deform_port(phy, true);
313313
}
314314

315315
void sas_porte_hard_reset(struct work_struct *work)
316316
{
317317
struct asd_sas_event *ev = to_asd_sas_event(work);
318318
struct asd_sas_phy *phy = ev->phy;
319319

320-
sas_deform_port(phy, 1);
320+
sas_deform_port(phy, true);
321321
}
322322

323323
/* ---------- SAS port registration ---------- */
@@ -358,8 +358,7 @@ void sas_unregister_ports(struct sas_ha_struct *sas_ha)
358358

359359
for (i = 0; i < sas_ha->num_phys; i++)
360360
if (sas_ha->sas_phy[i]->port)
361-
sas_deform_port(sas_ha->sas_phy[i], 0);
362-
361+
sas_deform_port(sas_ha->sas_phy[i], false);
363362
}
364363

365364
const work_func_t sas_port_event_fns[PORT_NUM_EVENTS] = {

drivers/scsi/mpt3sas/mpt3sas_scsih.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10809,8 +10809,7 @@ _mpt3sas_fw_work(struct MPT3SAS_ADAPTER *ioc, struct fw_event_work *fw_event)
1080910809
break;
1081010810
case MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST:
1081110811
_scsih_pcie_topology_change_event(ioc, fw_event);
10812-
ioc->current_event = NULL;
10813-
return;
10812+
break;
1081410813
}
1081510814
out:
1081610815
fw_event_work_put(fw_event);

0 commit comments

Comments
 (0)