Skip to content

Commit 1da615d

Browse files
James BottomleyJames Bottomley
authored andcommitted
Merge branch 'misc' into for-next
2 parents b1c94fb + f3f50c7 commit 1da615d

18 files changed

+274
-356
lines changed

MAINTAINERS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11144,7 +11144,6 @@ M: Sagi Grimberg <sagi@grimberg.me>
1114411144
L: linux-rdma@vger.kernel.org
1114511145
L: target-devel@vger.kernel.org
1114611146
S: Supported
11147-
W: http://www.linux-iscsi.org
1114811147
T: git git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master
1114911148
F: drivers/infiniband/ulp/isert
1115011149

@@ -19162,7 +19161,6 @@ M: "Martin K. Petersen" <martin.petersen@oracle.com>
1916219161
L: linux-scsi@vger.kernel.org
1916319162
L: target-devel@vger.kernel.org
1916419163
S: Supported
19165-
W: http://www.linux-iscsi.org
1916619164
Q: https://patchwork.kernel.org/project/target-devel/list/
1916719165
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
1916819166
F: Documentation/target/

drivers/scsi/hisi_sas/hisi_sas.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ struct hisi_sas_hw {
343343
u8 reg_index, u8 reg_count, u8 *write_data);
344344
void (*wait_cmds_complete_timeout)(struct hisi_hba *hisi_hba,
345345
int delay_ms, int timeout_ms);
346-
void (*debugfs_snapshot_regs)(struct hisi_hba *hisi_hba);
346+
int (*debugfs_snapshot_regs)(struct hisi_hba *hisi_hba);
347347
int complete_hdr_size;
348348
const struct scsi_host_template *sht;
349349
};
@@ -451,7 +451,6 @@ struct hisi_hba {
451451
const struct hisi_sas_hw *hw; /* Low level hw interface */
452452
unsigned long sata_dev_bitmap[BITS_TO_LONGS(HISI_SAS_MAX_DEVICES)];
453453
struct work_struct rst_work;
454-
struct work_struct debugfs_work;
455454
u32 phy_state;
456455
u32 intr_coal_ticks; /* Time of interrupt coalesce in us */
457456
u32 intr_coal_count; /* Interrupt count to coalesce */

drivers/scsi/hisi_sas/hisi_sas_main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,8 +1958,11 @@ static bool hisi_sas_internal_abort_timeout(struct sas_task *task,
19581958
struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
19591959
struct hisi_sas_internal_abort_data *timeout = data;
19601960

1961-
if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct)
1962-
queue_work(hisi_hba->wq, &hisi_hba->debugfs_work);
1961+
if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct) {
1962+
down(&hisi_hba->sem);
1963+
hisi_hba->hw->debugfs_snapshot_regs(hisi_hba);
1964+
up(&hisi_hba->sem);
1965+
}
19631966

19641967
if (task->task_state_flags & SAS_TASK_STATE_DONE) {
19651968
pr_err("Internal abort: timeout %016llx\n",

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 53 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,7 @@ static int experimental_iopoll_q_cnt;
558558
module_param(experimental_iopoll_q_cnt, int, 0444);
559559
MODULE_PARM_DESC(experimental_iopoll_q_cnt, "number of queues to be used as poll mode, def=0");
560560

561-
static void debugfs_work_handler_v3_hw(struct work_struct *work);
562-
static void debugfs_snapshot_regs_v3_hw(struct hisi_hba *hisi_hba);
561+
static int debugfs_snapshot_regs_v3_hw(struct hisi_hba *hisi_hba);
563562

564563
static u32 hisi_sas_read32(struct hisi_hba *hisi_hba, u32 off)
565564
{
@@ -3388,7 +3387,6 @@ hisi_sas_shost_alloc_pci(struct pci_dev *pdev)
33883387
hisi_hba = shost_priv(shost);
33893388

33903389
INIT_WORK(&hisi_hba->rst_work, hisi_sas_rst_work_handler);
3391-
INIT_WORK(&hisi_hba->debugfs_work, debugfs_work_handler_v3_hw);
33923390
hisi_hba->hw = &hisi_sas_v3_hw;
33933391
hisi_hba->pci_dev = pdev;
33943392
hisi_hba->dev = dev;
@@ -3860,47 +3858,13 @@ static void debugfs_create_files_v3_hw(struct hisi_hba *hisi_hba)
38603858
&debugfs_ras_v3_hw_fops);
38613859
}
38623860

3863-
static void debugfs_snapshot_regs_v3_hw(struct hisi_hba *hisi_hba)
3864-
{
3865-
int debugfs_dump_index = hisi_hba->debugfs_dump_index;
3866-
struct device *dev = hisi_hba->dev;
3867-
u64 timestamp = local_clock();
3868-
3869-
if (debugfs_dump_index >= hisi_sas_debugfs_dump_count) {
3870-
dev_warn(dev, "dump count exceeded!\n");
3871-
return;
3872-
}
3873-
3874-
do_div(timestamp, NSEC_PER_MSEC);
3875-
hisi_hba->debugfs_timestamp[debugfs_dump_index] = timestamp;
3876-
3877-
debugfs_snapshot_prepare_v3_hw(hisi_hba);
3878-
3879-
debugfs_snapshot_global_reg_v3_hw(hisi_hba);
3880-
debugfs_snapshot_port_reg_v3_hw(hisi_hba);
3881-
debugfs_snapshot_axi_reg_v3_hw(hisi_hba);
3882-
debugfs_snapshot_ras_reg_v3_hw(hisi_hba);
3883-
debugfs_snapshot_cq_reg_v3_hw(hisi_hba);
3884-
debugfs_snapshot_dq_reg_v3_hw(hisi_hba);
3885-
debugfs_snapshot_itct_reg_v3_hw(hisi_hba);
3886-
debugfs_snapshot_iost_reg_v3_hw(hisi_hba);
3887-
3888-
debugfs_create_files_v3_hw(hisi_hba);
3889-
3890-
debugfs_snapshot_restore_v3_hw(hisi_hba);
3891-
hisi_hba->debugfs_dump_index++;
3892-
}
3893-
38943861
static ssize_t debugfs_trigger_dump_v3_hw_write(struct file *file,
38953862
const char __user *user_buf,
38963863
size_t count, loff_t *ppos)
38973864
{
38983865
struct hisi_hba *hisi_hba = file->f_inode->i_private;
38993866
char buf[8];
39003867

3901-
if (hisi_hba->debugfs_dump_index >= hisi_sas_debugfs_dump_count)
3902-
return -EFAULT;
3903-
39043868
if (count > 8)
39053869
return -EFAULT;
39063870

@@ -3910,7 +3874,12 @@ static ssize_t debugfs_trigger_dump_v3_hw_write(struct file *file,
39103874
if (buf[0] != '1')
39113875
return -EFAULT;
39123876

3913-
queue_work(hisi_hba->wq, &hisi_hba->debugfs_work);
3877+
down(&hisi_hba->sem);
3878+
if (debugfs_snapshot_regs_v3_hw(hisi_hba)) {
3879+
up(&hisi_hba->sem);
3880+
return -EFAULT;
3881+
}
3882+
up(&hisi_hba->sem);
39143883

39153884
return count;
39163885
}
@@ -4661,14 +4630,6 @@ static void debugfs_fifo_init_v3_hw(struct hisi_hba *hisi_hba)
46614630
}
46624631
}
46634632

4664-
static void debugfs_work_handler_v3_hw(struct work_struct *work)
4665-
{
4666-
struct hisi_hba *hisi_hba =
4667-
container_of(work, struct hisi_hba, debugfs_work);
4668-
4669-
debugfs_snapshot_regs_v3_hw(hisi_hba);
4670-
}
4671-
46724633
static void debugfs_release_v3_hw(struct hisi_hba *hisi_hba, int dump_index)
46734634
{
46744635
struct device *dev = hisi_hba->dev;
@@ -4703,7 +4664,7 @@ static int debugfs_alloc_v3_hw(struct hisi_hba *hisi_hba, int dump_index)
47034664
{
47044665
const struct hisi_sas_hw *hw = hisi_hba->hw;
47054666
struct device *dev = hisi_hba->dev;
4706-
int p, c, d, r, i;
4667+
int p, c, d, r;
47074668
size_t sz;
47084669

47094670
for (r = 0; r < DEBUGFS_REGS_NUM; r++) {
@@ -4783,11 +4744,48 @@ static int debugfs_alloc_v3_hw(struct hisi_hba *hisi_hba, int dump_index)
47834744

47844745
return 0;
47854746
fail:
4786-
for (i = 0; i < hisi_sas_debugfs_dump_count; i++)
4787-
debugfs_release_v3_hw(hisi_hba, i);
4747+
debugfs_release_v3_hw(hisi_hba, dump_index);
47884748
return -ENOMEM;
47894749
}
47904750

4751+
static int debugfs_snapshot_regs_v3_hw(struct hisi_hba *hisi_hba)
4752+
{
4753+
int debugfs_dump_index = hisi_hba->debugfs_dump_index;
4754+
struct device *dev = hisi_hba->dev;
4755+
u64 timestamp = local_clock();
4756+
4757+
if (debugfs_dump_index >= hisi_sas_debugfs_dump_count) {
4758+
dev_warn(dev, "dump count exceeded!\n");
4759+
return -EINVAL;
4760+
}
4761+
4762+
if (debugfs_alloc_v3_hw(hisi_hba, debugfs_dump_index)) {
4763+
dev_warn(dev, "failed to alloc memory\n");
4764+
return -ENOMEM;
4765+
}
4766+
4767+
do_div(timestamp, NSEC_PER_MSEC);
4768+
hisi_hba->debugfs_timestamp[debugfs_dump_index] = timestamp;
4769+
4770+
debugfs_snapshot_prepare_v3_hw(hisi_hba);
4771+
4772+
debugfs_snapshot_global_reg_v3_hw(hisi_hba);
4773+
debugfs_snapshot_port_reg_v3_hw(hisi_hba);
4774+
debugfs_snapshot_axi_reg_v3_hw(hisi_hba);
4775+
debugfs_snapshot_ras_reg_v3_hw(hisi_hba);
4776+
debugfs_snapshot_cq_reg_v3_hw(hisi_hba);
4777+
debugfs_snapshot_dq_reg_v3_hw(hisi_hba);
4778+
debugfs_snapshot_itct_reg_v3_hw(hisi_hba);
4779+
debugfs_snapshot_iost_reg_v3_hw(hisi_hba);
4780+
4781+
debugfs_create_files_v3_hw(hisi_hba);
4782+
4783+
debugfs_snapshot_restore_v3_hw(hisi_hba);
4784+
hisi_hba->debugfs_dump_index++;
4785+
4786+
return 0;
4787+
}
4788+
47914789
static void debugfs_phy_down_cnt_init_v3_hw(struct hisi_hba *hisi_hba)
47924790
{
47934791
struct dentry *dir = debugfs_create_dir("phy_down_cnt",
@@ -4865,10 +4863,15 @@ static void debugfs_bist_init_v3_hw(struct hisi_hba *hisi_hba)
48654863
hisi_hba->debugfs_bist_linkrate = SAS_LINK_RATE_1_5_GBPS;
48664864
}
48674865

4866+
static void debugfs_exit_v3_hw(struct hisi_hba *hisi_hba)
4867+
{
4868+
debugfs_remove_recursive(hisi_hba->debugfs_dir);
4869+
hisi_hba->debugfs_dir = NULL;
4870+
}
4871+
48684872
static void debugfs_init_v3_hw(struct hisi_hba *hisi_hba)
48694873
{
48704874
struct device *dev = hisi_hba->dev;
4871-
int i;
48724875

48734876
hisi_hba->debugfs_dir = debugfs_create_dir(dev_name(dev),
48744877
hisi_sas_debugfs_dir);
@@ -4885,19 +4888,6 @@ static void debugfs_init_v3_hw(struct hisi_hba *hisi_hba)
48854888

48864889
debugfs_phy_down_cnt_init_v3_hw(hisi_hba);
48874890
debugfs_fifo_init_v3_hw(hisi_hba);
4888-
4889-
for (i = 0; i < hisi_sas_debugfs_dump_count; i++) {
4890-
if (debugfs_alloc_v3_hw(hisi_hba, i)) {
4891-
debugfs_remove_recursive(hisi_hba->debugfs_dir);
4892-
dev_dbg(dev, "failed to init debugfs!\n");
4893-
break;
4894-
}
4895-
}
4896-
}
4897-
4898-
static void debugfs_exit_v3_hw(struct hisi_hba *hisi_hba)
4899-
{
4900-
debugfs_remove_recursive(hisi_hba->debugfs_dir);
49014891
}
49024892

49034893
static int

drivers/scsi/pm8001/pm8001_hwi.c

Lines changed: 16 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,65 +1180,6 @@ void pm8001_chip_iounmap(struct pm8001_hba_info *pm8001_ha)
11801180
}
11811181
}
11821182

1183-
#ifndef PM8001_USE_MSIX
1184-
/**
1185-
* pm8001_chip_intx_interrupt_enable - enable PM8001 chip interrupt
1186-
* @pm8001_ha: our hba card information
1187-
*/
1188-
static void
1189-
pm8001_chip_intx_interrupt_enable(struct pm8001_hba_info *pm8001_ha)
1190-
{
1191-
pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_CLEAR_ALL);
1192-
pm8001_cw32(pm8001_ha, 0, MSGU_ODCR, ODCR_CLEAR_ALL);
1193-
}
1194-
1195-
/**
1196-
* pm8001_chip_intx_interrupt_disable - disable PM8001 chip interrupt
1197-
* @pm8001_ha: our hba card information
1198-
*/
1199-
static void
1200-
pm8001_chip_intx_interrupt_disable(struct pm8001_hba_info *pm8001_ha)
1201-
{
1202-
pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL);
1203-
}
1204-
1205-
#else
1206-
1207-
/**
1208-
* pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt
1209-
* @pm8001_ha: our hba card information
1210-
* @int_vec_idx: interrupt number to enable
1211-
*/
1212-
static void
1213-
pm8001_chip_msix_interrupt_enable(struct pm8001_hba_info *pm8001_ha,
1214-
u32 int_vec_idx)
1215-
{
1216-
u32 msi_index;
1217-
u32 value;
1218-
msi_index = int_vec_idx * MSIX_TABLE_ELEMENT_SIZE;
1219-
msi_index += MSIX_TABLE_BASE;
1220-
pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_ENABLE);
1221-
value = (1 << int_vec_idx);
1222-
pm8001_cw32(pm8001_ha, 0, MSGU_ODCR, value);
1223-
1224-
}
1225-
1226-
/**
1227-
* pm8001_chip_msix_interrupt_disable - disable PM8001 chip interrupt
1228-
* @pm8001_ha: our hba card information
1229-
* @int_vec_idx: interrupt number to disable
1230-
*/
1231-
static void
1232-
pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha,
1233-
u32 int_vec_idx)
1234-
{
1235-
u32 msi_index;
1236-
msi_index = int_vec_idx * MSIX_TABLE_ELEMENT_SIZE;
1237-
msi_index += MSIX_TABLE_BASE;
1238-
pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_DISABLE);
1239-
}
1240-
#endif
1241-
12421183
/**
12431184
* pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
12441185
* @pm8001_ha: our hba card information
@@ -1247,11 +1188,14 @@ pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha,
12471188
static void
12481189
pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
12491190
{
1250-
#ifdef PM8001_USE_MSIX
1251-
pm8001_chip_msix_interrupt_enable(pm8001_ha, 0);
1252-
#else
1253-
pm8001_chip_intx_interrupt_enable(pm8001_ha);
1254-
#endif
1191+
if (pm8001_ha->use_msix) {
1192+
pm8001_cw32(pm8001_ha, 0, MSIX_TABLE_BASE,
1193+
MSIX_INTERRUPT_ENABLE);
1194+
pm8001_cw32(pm8001_ha, 0, MSGU_ODCR, 1);
1195+
} else {
1196+
pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_CLEAR_ALL);
1197+
pm8001_cw32(pm8001_ha, 0, MSGU_ODCR, ODCR_CLEAR_ALL);
1198+
}
12551199
}
12561200

12571201
/**
@@ -1262,11 +1206,11 @@ pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
12621206
static void
12631207
pm8001_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec)
12641208
{
1265-
#ifdef PM8001_USE_MSIX
1266-
pm8001_chip_msix_interrupt_disable(pm8001_ha, 0);
1267-
#else
1268-
pm8001_chip_intx_interrupt_disable(pm8001_ha);
1269-
#endif
1209+
if (pm8001_ha->use_msix)
1210+
pm8001_cw32(pm8001_ha, 0, MSIX_TABLE_BASE,
1211+
MSIX_INTERRUPT_DISABLE);
1212+
else
1213+
pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL);
12701214
}
12711215

12721216
/**
@@ -4309,16 +4253,15 @@ static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
43094253

43104254
static u32 pm8001_chip_is_our_interrupt(struct pm8001_hba_info *pm8001_ha)
43114255
{
4312-
#ifdef PM8001_USE_MSIX
4313-
return 1;
4314-
#else
43154256
u32 value;
43164257

4258+
if (pm8001_ha->use_msix)
4259+
return 1;
4260+
43174261
value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
43184262
if (value)
43194263
return 1;
43204264
return 0;
4321-
#endif
43224265
}
43234266

43244267
/**

0 commit comments

Comments
 (0)