-
Notifications
You must be signed in to change notification settings - Fork 125
[Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] Update kernel base to 6.6.125,6.6.126 #1505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
06f13aa
c40f9a2
c3d3ad1
186b6f2
95f1b1c
290716e
fde02f0
f78bd7c
454e262
ba26b5d
3d944a9
71f445b
a6673bf
c77e169
cebf78e
5e653a0
9b1b53f
62a78dc
74dc36b
25e794f
9027fb8
cf6241f
0074c7c
2781e90
7a7fd5c
13d795b
bd23811
3120bf1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1676,13 +1676,28 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) | |||||
|
|
||||||
| /* Port logout */ | ||||||
| fcport = qla2x00_find_fcport_by_loopid(vha, mb[1]); | ||||||
| if (!fcport) | ||||||
| if (!fcport) { | ||||||
| ql_dbg(ql_dbg_async, vha, 0x5011, | ||||||
| "Could not find fcport:%04x %04x %04x\n", | ||||||
| mb[1], mb[2], mb[3]); | ||||||
| break; | ||||||
| if (atomic_read(&fcport->state) != FCS_ONLINE) | ||||||
| } | ||||||
|
|
||||||
| if (atomic_read(&fcport->state) != FCS_ONLINE) { | ||||||
| ql_dbg(ql_dbg_async, vha, 0x5012, | ||||||
| "Port state is not online State:0x%x \n", | ||||||
| atomic_read(&fcport->state)); | ||||||
| ql_dbg(ql_dbg_async, vha, 0x5012, | ||||||
| "Scheduling session for deletion \n"); | ||||||
|
||||||
| "Scheduling session for deletion \n"); | |
| "Scheduling session for deletion\n"); |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -100,6 +100,8 @@ struct cqspi_st { | |||||||
| bool apb_ahb_hazard; | ||||||||
|
|
||||||||
| bool is_jh7110; /* Flag for StarFive JH7110 SoC */ | ||||||||
| refcount_t refcount; | ||||||||
| refcount_t inflight_ops; | ||||||||
| }; | ||||||||
|
|
||||||||
| struct cqspi_driver_platdata { | ||||||||
|
|
@@ -705,6 +707,9 @@ static int cqspi_indirect_read_execute(struct cqspi_flash_pdata *f_pdata, | |||||||
| u8 *rxbuf_end = rxbuf + n_rx; | ||||||||
| int ret = 0; | ||||||||
|
|
||||||||
| if (!refcount_read(&cqspi->refcount)) | ||||||||
| return -ENODEV; | ||||||||
|
|
||||||||
| writel(from_addr, reg_base + CQSPI_REG_INDIRECTRDSTARTADDR); | ||||||||
| writel(remaining, reg_base + CQSPI_REG_INDIRECTRDBYTES); | ||||||||
|
|
||||||||
|
|
@@ -1021,6 +1026,9 @@ static int cqspi_indirect_write_execute(struct cqspi_flash_pdata *f_pdata, | |||||||
| unsigned int write_bytes; | ||||||||
| int ret; | ||||||||
|
|
||||||||
| if (!refcount_read(&cqspi->refcount)) | ||||||||
| return -ENODEV; | ||||||||
|
|
||||||||
| writel(to_addr, reg_base + CQSPI_REG_INDIRECTWRSTARTADDR); | ||||||||
| writel(remaining, reg_base + CQSPI_REG_INDIRECTWRBYTES); | ||||||||
|
|
||||||||
|
|
@@ -1412,11 +1420,29 @@ static int cqspi_mem_process(struct spi_mem *mem, const struct spi_mem_op *op) | |||||||
| static int cqspi_exec_mem_op(struct spi_mem *mem, const struct spi_mem_op *op) | ||||||||
| { | ||||||||
| int ret; | ||||||||
| struct cqspi_st *cqspi = spi_controller_get_devdata(mem->spi->controller); | ||||||||
|
|
||||||||
| if (refcount_read(&cqspi->inflight_ops) == 0) | ||||||||
| return -ENODEV; | ||||||||
|
|
||||||||
| if (!refcount_read(&cqspi->refcount)) | ||||||||
| return -EBUSY; | ||||||||
|
|
||||||||
| refcount_inc(&cqspi->inflight_ops); | ||||||||
|
|
||||||||
| if (!refcount_read(&cqspi->refcount)) { | ||||||||
| if (refcount_read(&cqspi->inflight_ops)) | ||||||||
| refcount_dec(&cqspi->inflight_ops); | ||||||||
| return -EBUSY; | ||||||||
| } | ||||||||
|
|
||||||||
| ret = cqspi_mem_process(mem, op); | ||||||||
| if (ret) | ||||||||
| dev_err(&mem->spi->dev, "operation failed with %d\n", ret); | ||||||||
|
|
||||||||
| if (refcount_read(&cqspi->inflight_ops) > 1) | ||||||||
| refcount_dec(&cqspi->inflight_ops); | ||||||||
|
Comment on lines
+1443
to
+1444
|
||||||||
| if (refcount_read(&cqspi->inflight_ops) > 1) | |
| refcount_dec(&cqspi->inflight_ops); | |
| refcount_dec(&cqspi->inflight_ops); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refcount_set(&cqspi->inflight_ops, 1); will be run in cqspi_probe, need to be keep it.
Copilot
AI
Feb 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The refcount_dec_and_test logic appears inverted. Since inflight_ops is initialized to 1 and decremented here, the function should wait for idle when the test returns true (i.e., when the counter reaches 0), not when it returns false. The current logic will wait when there are still operations in flight but not wait when the counter has reached zero, which is backwards.
| if (!refcount_dec_and_test(&cqspi->inflight_ops)) | |
| if (refcount_dec_and_test(&cqspi->inflight_ops)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refcount_set(&cqspi->inflight_ops, 1); will be run in cqspi_probe, and if not wait "when the counter has reached zero" is not probed, so not need to cqspi_wait_idle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space before the newline escape character. The comment should have a space between "State:0x%x" and "\n" for consistency with standard formatting.