dmaengine: apple-admac: Keep upper bits of REG_BUS_WIDTH
Subsystems (8)
Sasha Levin
maintainerPATCH 1/10 dmaengine: apple-admac: Keep upper bits of REG_BUS_WIDTH
From: Hector Martin <[email protected]>
[ Upstream commit 306f5df81fcc89b462fbeb9dbe26d9a8ad7c7582 ]
For RX channels, REG_BUS_WIDTH seems to default to a value of 0xf00, and macOS preserves the upper bits when setting the configuration in the lower ones. If we reset the upper bits to 0, this causes framing errors on suspend/resume (the data stream "tears" and channels get swapped around). Keeping the upper bits untouched, like the macOS driver does, fixes this issue.
--- drivers/dma/apple-admac.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/dma/apple-admac.c +4 -1
@@ -57,6 +57,8 @@#define REG_BUS_WIDTH (ch) (0x8040 + (ch) * 0x200) +#define BUS_WIDTH_WORD_SIZE GENMASK(3, 0) +#define BUS_WIDTH_FRAME_SIZE GENMASK(7, 4)#define BUS_WIDTH_8BIT 0x00#define BUS_WIDTH_16BIT 0x01#define BUS_WIDTH_32BIT 0x02
@@ -740,7 +742,8 @@ static int admac_device_config(struct dma_chan *chan,struct admac_data *ad = adchan->host;bool is_tx =admac_chan_direction (adchan->no) ==DMA_MEM_TO_DEV ;int wordsize =0 ; -u32 bus_width =0 ; +u32 bus_width =readl_relaxed (ad->base +REG_BUS_WIDTH (adchan->no)) & + ~(BUS_WIDTH_WORD_SIZE |BUS_WIDTH_FRAME_SIZE );switch (is_tx ? config->dst_addr_width : config->src_addr_width) {case DMA_SLAVE_BUSWIDTH_1_BYTE :
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 2/10 scsi: smartpqi: Add new controller PCI IDs
From: David Strahan <[email protected]>
[ Upstream commit c6d5aa44eaf6d119f9ceb3bfc7d22405ac04232a ]
All PCI ID entries in Hex.
Add PCI IDs for Cisco controllers:
VID / DID / SVID / SDID
---- ---- ---- ----
Cisco 24G TriMode M1 RAID 4GB FBWC 32D 9005 / 028f / 1137 / 02f8
Cisco 24G TriMode M1 RAID 4GB FBWC 16D 9005 / 028f / 1137 / 02f9
Cisco 24G TriMode M1 HBA 16D 9005 / 028f / 1137 / 02faAdd PCI IDs for CloudNine controllers:
VID / DID / SVID / SDID
---- ---- ---- ----
SmartRAID P7604N-16i 9005 / 028f / 1f51 / 100e
SmartRAID P7604N-8i 9005 / 028f / 1f51 / 100f
SmartRAID P7504N-16i 9005 / 028f / 1f51 / 1010
SmartRAID P7504N-8i 9005 / 028f / 1f51 / 1011
SmartRAID P7504N-8i 9005 / 028f / 1f51 / 1043
SmartHBA P6500-8i 9005 / 028f / 1f51 / 1044
SmartRAID P7504-8i 9005 / 028f / 1f51 / 1045--- drivers/scsi/smartpqi/smartpqi_init.c | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
drivers/scsi/smartpqi/smartpqi_init.c +40 -0
@@ -10142,6 +10142,18 @@ static const struct pci_device_id pqi_pci_id_table[] = {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,0x1014 ,0x0718 ) }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1137 ,0x02f8 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1137 ,0x02f9 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1137 ,0x02fa ) + }, {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,0x1e93 ,0x1000 )
@@ -10198,6 +10210,34 @@ static const struct pci_device_id pqi_pci_id_table[] = {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,0x1f51 ,0x100a ) }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1f51 ,0x100e ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1f51 ,0x100f ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1f51 ,0x1010 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1f51 ,0x1011 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1f51 ,0x1043 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1f51 ,0x1044 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1f51 ,0x1045 ) + }, {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,PCI_ANY_ID ,PCI_ANY_ID )
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 3/10 scsi: smartpqi: Fix logical volume rescan race condition
In reply to Sasha LevinFrom: Mahesh Rajashekhara <[email protected]>
[ Upstream commit fb4cece17b4583f55b34a8538e27a4adc833c9d4 ]
Correct rescan flag race condition.
Multiple conditions are being evaluated before notifying OS to do a rescan.
Driver will skip rescanning the device if any one of the following conditions are met:
- Devices that have not yet been added to the OS or devices that have been removed.
- Devices which are already marked for removal or in the phase of removal.
Under very rare conditions, after logical volume size expansion, the OS still sees the size of the logical volume which was before expansion.
The rescan flag in the driver is used to signal the need for a logical volume rescan. A race condition can occur in the driver, and it leads to one thread overwriting the flag inadvertently. As a result, driver is not notifying the OS SML to rescan the logical volume.
Move device->rescan update into new function pqi_mark_volumes_for_rescan() and protect with a spin lock.
Move check for device->rescan into new function pqi_volume_rescan_needed() and protect function call with a spin_lock.
--- drivers/scsi/smartpqi/smartpqi.h | 1 - drivers/scsi/smartpqi/smartpqi_init.c | 43 ++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 8 deletions(-)
drivers/scsi/smartpqi/smartpqi.h +0 -1
@@ -1347,7 +1347,6 @@ struct pqi_ctrl_info {bool controller_online;bool block_requests;bool scan_blocked; - u8 logical_volume_rescan_needed : 1; u8 inbound_spanning_supported : 1; u8 outbound_spanning_supported : 1; u8 pqi_mode_enabled : 1;
drivers/scsi/smartpqi/smartpqi_init.c +36 -7
80 lines not on this page · raw message
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 4/10 tools: selftests: riscv: Fix compile warnings in vector tests
In reply to Sasha LevinFrom: Christoph Müllner <[email protected]>
[ Upstream commit e1baf5e68ed128c1e22ba43e5190526d85de323c ]
GCC prints a couple of format string warnings when compiling the vector tests. Let's follow the recommendation in Documentation/printk-formats.txt to fix these warnings.
--- tools/testing/selftests/riscv/vector/v_initval_nolibc.c | 2 +- tools/testing/selftests/riscv/vector/vstate_prctl.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/riscv/vector/v_initval_nolibc.c +1 -1
@@ -27,7 +27,7 @@ int main(void) datap =malloc (MAX_VSIZE );if (!datap) { -ksft_test_result_fail ("fail to allocate memory for size = %lu\n" ,MAX_VSIZE ); +ksft_test_result_fail ("fail to allocate memory for size = %d\n" ,MAX_VSIZE );exit (-1 ); }
tools/testing/selftests/riscv/vector/vstate_prctl.c +2 -2
@@ -68,7 +68,7 @@ int test_and_compare_child(long provided, long expected, int inherit) } rc =launch_test (inherit);if (rc != expected) { -ksft_test_result_fail ("Test failed, check %d != %d\n" , rc, +ksft_test_result_fail ("Test failed, check %d != %ld\n" , rc, expected);return -2 ; }
@@ -87,7 +87,7 @@ int main(void) pair.key =RISCV_HWPROBE_KEY_IMA_EXT_0 ; rc =riscv_hwprobe (&pair,1 ,0 ,NULL ,0 );if (rc <0 ) { -ksft_test_result_fail ("hwprobe() failed with %d\n" , rc); +ksft_test_result_fail ("hwprobe() failed with %ld\n" , rc);return -1 ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 5/10 tools: selftests: riscv: Fix compile warnings in mm tests
In reply to Sasha LevinFrom: Christoph Müllner <[email protected]>
[ Upstream commit 12c16919652b5873f524c8b361336ecfa5ce5e6b ]
When building the mm tests with a riscv32 compiler, we see a range of shift-count-overflow errors from shifting 1UL by more than 32 bits in do_mmaps(). Since, the relevant code is only called from code that is gated by __riscv_xlen == 64, we can just apply the same gating to do_mmaps().
--- tools/testing/selftests/riscv/mm/mmap_test.h | 3 +++ 1 file changed, 3 insertions(+)
tools/testing/selftests/riscv/mm/mmap_test.h +3 -0
@@ -18,6 +18,8 @@ struct addresses {int *on_56_addr; }; +// Only works on 64 bit +#if __riscv_xlen ==64 static inline void do_mmaps (struct addresses *mmap_addresses) {/*
@@ -50,6 +52,7 @@ static inline void do_mmaps(struct addresses *mmap_addresses) mmap_addresses->on_56_addr = mmap(on_56_bits, 5 * sizeof(int), prot, flags, 0, 0); } +#endif /* __riscv_xlen == 64 */ static inline int memory_layout (void ) {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 6/10 scsi: target: core: Add TMF to tmr_list handling
In reply to Sasha LevinFrom: Dmitry Bogdanov <[email protected]>
[ Upstream commit 83ab68168a3d990d5ff39ab030ad5754cbbccb25 ]
An abort that is responded to by iSCSI itself is added to tmr_list but does not go to target core. A LUN_RESET that goes through tmr_list takes a refcounter on the abort and waits for completion. However, the abort will be never complete because it was not started in target core.
Unable to locate ITT: 0x05000000 on CID: 0
Unable to locate RefTaskTag: 0x05000000 on CID: 0.
wait_for_tasks: Stopping tmf LUN_RESET with tag 0x0 ref_task_tag 0x0 i_state 34 t_state ISTATE_PROCESSING refcnt 2 transport_state active,stop,fabric_stop wait for tasks: tmf LUN_RESET with tag 0x0 ref_task_tag 0x0 i_state 34 t_state ISTATE_PROCESSING refcnt 2 transport_state active,stop,fabric_stop
...
INFO: task kworker/0:2:49 blocked for more than 491 seconds. task:kworker/0:2 state:D stack: 0 pid: 49 ppid: 2 flags:0x00000800 Workqueue: events target_tmr_work [target_core_mod] Call Trace: __switch_to+0x2c4/0x470 _schedule+0x314/0x1730 schedule+0x64/0x130 schedule_timeout+0x168/0x430 wait_for_completion+0x140/0x270 target_put_cmd_and_wait+0x64/0xb0 [target_core_mod] core_tmr_lun_reset+0x30/0xa0 [target_core_mod] target_tmr_work+0xc8/0x1b0 [target_core_mod] process_one_work+0x2d4/0x5d0 worker_thread+0x78/0x6c0
To fix this, only add abort to tmr_list if it will be handled by target core.
--- drivers/target/target_core_device.c | 5 ----- drivers/target/target_core_transport.c | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/target/target_core_device.c +0 -5
@@ -147,7 +147,6 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd)struct se_session *se_sess = se_cmd->se_sess;struct se_node_acl *nacl = se_sess->se_node_acl;struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; -unsigned long flags;rcu_read_lock (); deve =target_nacl_find_deve (nacl, se_cmd->orig_fe_lun);
@@ -178,10 +177,6 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd) se_cmd->se_dev =rcu_dereference_raw (se_lun->lun_se_dev); se_tmr->tmr_dev =rcu_dereference_raw (se_lun->lun_se_dev); -spin_lock_irqsave (&se_tmr->tmr_dev->se_tmr_lock, flags); -list_add_tail (&se_tmr->tmr_list, &se_tmr->tmr_dev->dev_tmr_list); -spin_unlock_irqrestore (&se_tmr->tmr_dev->se_tmr_lock, flags); -return 0 ; }EXPORT_SYMBOL (transport_lookup_tmr_lun);
drivers/target/target_core_transport.c +4 -0
@@ -3627,6 +3627,10 @@ int transport_generic_handle_tmr(unsigned long flags;bool aborted = false; +spin_lock_irqsave (&cmd->se_dev->se_tmr_lock, flags); +list_add_tail (&cmd->se_tmr_req->tmr_list, &cmd->se_dev->dev_tmr_list); +spin_unlock_irqrestore (&cmd->se_dev->se_tmr_lock, flags); +spin_lock_irqsave (&cmd->t_state_lock, flags);if (cmd->transport_state &CMD_T_ABORTED ) { aborted = true;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 7/10 cifs: open_cached_dir should not rely on primary channel
In reply to Sasha LevinFrom: Shyam Prasad N <[email protected]>
[ Upstream commit 936eba9cfb5cfbf6a2c762cd163605f2b784e03e ]
open_cached_dir today selects ses->server a.k.a primary channel to send requests. When multichannel is used, the primary channel maybe down. So it does not make sense to rely only on that channel.
This fix makes this function pick a channel with the standard helper function cifs_pick_channel.
--- fs/smb/client/cached_dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/cached_dir.c +1 -1
@@ -151,7 +151,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,return -EOPNOTSUPP ; ses = tcon->ses; - server = ses->server; + server =cifs_pick_channel (ses); cfids = tcon->cfids;if (!server->ops->new_lease_key)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 8/10 dmaengine: shdma: increase size of 'dev_id'
In reply to Sasha LevinFrom: Vinod Koul <[email protected]>
[ Upstream commit 404290240827c3bb5c4e195174a8854eef2f89ac ]
We seem to have hit warnings of 'output may be truncated' which is fixed by increasing the size of 'dev_id'
drivers/dma/sh/shdmac.c: In function ‘sh_dmae_probe’:drivers/dma/sh/shdmac.c:541:34: error: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 9 [-Werror=format-truncation=]
541 | "sh-dmae%d.%d", pdev->id, id);
| ^~
In function ‘sh_dmae_chan_probe’,
inlined from ‘sh_dmae_probe’ at drivers/dma/sh/shdmac.c:845:9:drivers/dma/sh/shdmac.c:541:26: note: directive argument in the range [0, 2147483647]
541 | "sh-dmae%d.%d", pdev->id, id);
| ^~~~~~~~~~~~~~
drivers/dma/sh/shdmac.c:541:26: note: directive argument in the range [0, 19]
drivers/dma/sh/shdmac.c:540:17: note: ‘snprintf’ output between 11 and 21 bytes into a destination of size 16
540 | snprintf(sh_chan->dev_id, sizeof(sh_chan->dev_id),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
541 | "sh-dmae%d.%d", pdev->id, id);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--- drivers/dma/sh/shdma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/sh/shdma.h +1 -1
@@ -25,7 +25,7 @@ struct sh_dmae_chan {const struct sh_dmae_slave_config *config;/* Slave DMA configuration */ int xmit_shift;/* log_2(bytes_per_xfer) */ void __iomem *base; -char dev_id[16 ];/* unique name per DMAC of channel */ +char dev_id[32 ];/* unique name per DMAC of channel */ int pm_error;dma_addr_t slave_addr; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 9/10 dmaengine: fsl-qdma: increase size of 'irq_name'
In reply to Sasha LevinFrom: Vinod Koul <[email protected]>
[ Upstream commit 6386f6c995b3ab91c72cfb76e4465553c555a8da ]
We seem to have hit warnings of 'output may be truncated' which is fixed by increasing the size of 'irq_name'
drivers/dma/fsl-qdma.c: In function ‘fsl_qdma_irq_init’:drivers/dma/fsl-qdma.c:824:46: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Werror=format-overflow=]
824 | sprintf(irq_name, "qdma-queue%d", i);
| ^~drivers/dma/fsl-qdma.c:824:35: note: directive argument in the range [-2147483641, 2147483646]
824 | sprintf(irq_name, "qdma-queue%d", i);
| ^~~~~~~~~~~~~~
drivers/dma/fsl-qdma.c:824:17: note: ‘sprintf’ output between 12 and 22 bytes into a destination of size 20
824 | sprintf(irq_name, "qdma-queue%d", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--- drivers/dma/fsl-qdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/fsl-qdma.c +1 -1
@@ -805,7 +805,7 @@ fsl_qdma_irq_init(struct platform_device *pdev,int i;int cpu;int ret; -char irq_name[20 ]; +char irq_name[32 ]; fsl_qdma->error_irq =platform_get_irq_byname (pdev,"qdma-error" );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 10/10 dmaengine: dw-edma: increase size of 'name' in debugfs code
In reply to Sasha LevinFrom: Vinod Koul <[email protected]>
[ Upstream commit cb95a4fa50bbc1262bfb7fea482388a50b12948f ]
We seem to have hit warnings of 'output may be truncated' which is fixed by increasing the size of 'name'
drivers/dma/dw-edma/dw-hdma-v0-debugfs.c: In function ‘dw_hdma_v0_debugfs_on’:drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:125:50: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Werror=format-truncation=]
125 | snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
| ^~
drivers/dma/dw-edma/dw-hdma-v0-debugfs.c: In function ‘dw_hdma_v0_debugfs_on’:drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:142:50: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Werror=format-truncation=]
142 | snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
| ^~drivers/dma/dw-edma/dw-edma-v0-debugfs.c: In function ‘dw_edma_debugfs_regs_wr’:drivers/dma/dw-edma/dw-edma-v0-debugfs.c:193:50: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Werror=format-truncation=]
193 | snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
| ^~
--- drivers/dma/dw-edma/dw-edma-v0-debugfs.c | 4 ++-- drivers/dma/dw-edma/dw-hdma-v0-debugfs.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/dma/dw-edma/dw-edma-v0-debugfs.c +2 -2
@@ -176,7 +176,7 @@ dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) };struct dentry *regs_dent, *ch_dent;int nr_entries, i; -char name[16 ]; +char name[32 ]; regs_dent =debugfs_create_dir (WRITE_STR , dent);
@@ -239,7 +239,7 @@ static noinline_for_stack void dw_edma_debugfs_regs_rd(struct dw_edma *dw, };struct dentry *regs_dent, *ch_dent;int nr_entries, i; -char name[16 ]; +char name[32 ]; regs_dent =debugfs_create_dir (READ_STR , dent);
drivers/dma/dw-edma/dw-hdma-v0-debugfs.c +2 -2
@@ -116,7 +116,7 @@ static void dw_hdma_debugfs_regs_ch(struct dw_edma *dw, enum dw_edma_dir dir,static void dw_hdma_debugfs_regs_wr (struct dw_edma *dw,struct dentry *dent) {struct dentry *regs_dent, *ch_dent; -char name[16 ]; +char name[32 ];int i; regs_dent =debugfs_create_dir (WRITE_STR , dent);
@@ -133,7 +133,7 @@ static void dw_hdma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent)static void dw_hdma_debugfs_regs_rd (struct dw_edma *dw,struct dentry *dent) {struct dentry *regs_dent, *ch_dent; -char name[16 ]; +char name[32 ];int i; regs_dent =debugfs_create_dir (READ_STR , dent);
Signature · 1 line
2.43.0