clk: qcom: mmcc-apq8084: remove spdm clocks
Subsystems (10)
Sasha Levin
maintainerPATCH 1/16 clk: qcom: mmcc-apq8084: remove spdm clocks
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 7b347f4b677b6d84687e67d82b6b17c6f55ea2b4 ]
SPDM is used for debug/profiling and does not have any other functionality. These clocks can safely be removed.
--- drivers/clk/qcom/mmcc-apq8084.c | 271 -------------------------------- 1 file changed, 271 deletions(-)
drivers/clk/qcom/mmcc-apq8084.c +0 -271
@@ -2364,262 +2364,6 @@ static struct clk_branch mmss_rbcpr_clk = { }, }; -static struct clk_branch mmss_spdm_ahb_clk = { - .halt_reg =0x0230 , - .clkr = { - .enable_reg =0x0230 , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_ahb_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_ahb_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_axi_clk = { - .halt_reg =0x0210 , - .clkr = { - .enable_reg =0x0210 , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_axi_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_axi_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_csi0_clk = { - .halt_reg =0x023c , - .clkr = { - .enable_reg =0x023c , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_csi0_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_csi0_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_gfx3d_clk = { - .halt_reg =0x022c , - .clkr = { - .enable_reg =0x022c , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_gfx3d_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_gfx3d_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_jpeg0_clk = { - .halt_reg =0x0204 , - .clkr = { - .enable_reg =0x0204 , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_jpeg0_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_jpeg0_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_jpeg1_clk = { - .halt_reg =0x0208 , - .clkr = { - .enable_reg =0x0208 , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_jpeg1_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_jpeg1_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_jpeg2_clk = { - .halt_reg =0x0224 , - .clkr = { - .enable_reg =0x0224 , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_jpeg2_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_jpeg2_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_mdp_clk = { - .halt_reg =0x020c , - .clkr = { - .enable_reg =0x020c , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_mdp_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_mdp_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_pclk0_clk = { - .halt_reg =0x0234 , - .clkr = { - .enable_reg =0x0234 , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_pclk0_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_pclk0_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_pclk1_clk = { - .halt_reg =0x0228 , - .clkr = { - .enable_reg =0x0228 , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_pclk1_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_pclk1_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_vcodec0_clk = { - .halt_reg =0x0214 , - .clkr = { - .enable_reg =0x0214 , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_vcodec0_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_vcodec0_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_vfe0_clk = { - .halt_reg =0x0218 , - .clkr = { - .enable_reg =0x0218 , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_vfe0_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_vfe0_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_vfe1_clk = { - .halt_reg =0x021c , - .clkr = { - .enable_reg =0x021c , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_vfe1_clk" , - .parent_names = (const char *[]){ -"mmss_spdm_vfe1_div_clk" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_rm_axi_clk = { - .halt_reg =0x0304 , - .clkr = { - .enable_reg =0x0304 , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_rm_axi_clk" , - .parent_names = (const char *[]){ -"mmss_axi_clk_src" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_spdm_rm_ocmemnoc_clk = { - .halt_reg =0x0308 , - .clkr = { - .enable_reg =0x0308 , - .enable_mask =BIT (0 ), - .hw.init = &(struct clk_init_data ){ - .name ="mmss_spdm_rm_ocmemnoc_clk" , - .parent_names = (const char *[]){ -"ocmemnoc_clk_src" , - }, - .num_parents =1 , - .flags =CLK_SET_RATE_PARENT , - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch mmss_misc_ahb_clk = { .halt_reg =0x502c , .clkr = {
@@ -3252,21 +2996,6 @@ static struct clk_regmap *mmcc_apq8084_clocks[] = { [MDSS_VSYNC_CLK] = &mdss_vsync_clk.clkr, [MMSS_RBCPR_AHB_CLK] = &mmss_rbcpr_ahb_clk.clkr, [MMSS_RBCPR_CLK] = &mmss_rbcpr_clk.clkr, - [MMSS_SPDM_AHB_CLK] = &mmss_spdm_ahb_clk.clkr, - [MMSS_SPDM_AXI_CLK] = &mmss_spdm_axi_clk.clkr, - [MMSS_SPDM_CSI0_CLK] = &mmss_spdm_csi0_clk.clkr, - [MMSS_SPDM_GFX3D_CLK] = &mmss_spdm_gfx3d_clk.clkr, - [MMSS_SPDM_JPEG0_CLK] = &mmss_spdm_jpeg0_clk.clkr, - [MMSS_SPDM_JPEG1_CLK] = &mmss_spdm_jpeg1_clk.clkr, - [MMSS_SPDM_JPEG2_CLK] = &mmss_spdm_jpeg2_clk.clkr, - [MMSS_SPDM_MDP_CLK] = &mmss_spdm_mdp_clk.clkr, - [MMSS_SPDM_PCLK0_CLK] = &mmss_spdm_pclk0_clk.clkr, - [MMSS_SPDM_PCLK1_CLK] = &mmss_spdm_pclk1_clk.clkr, - [MMSS_SPDM_VCODEC0_CLK] = &mmss_spdm_vcodec0_clk.clkr, - [MMSS_SPDM_VFE0_CLK] = &mmss_spdm_vfe0_clk.clkr, - [MMSS_SPDM_VFE1_CLK] = &mmss_spdm_vfe1_clk.clkr, - [MMSS_SPDM_RM_AXI_CLK] = &mmss_spdm_rm_axi_clk.clkr, - [MMSS_SPDM_RM_OCMEMNOC_CLK] = &mmss_spdm_rm_ocmemnoc_clk.clkr, [MMSS_MISC_AHB_CLK] = &mmss_misc_ahb_clk.clkr, [MMSS_MMSSNOC_AHB_CLK] = &mmss_mmssnoc_ahb_clk.clkr, [MMSS_MMSSNOC_BTO_AHB_CLK] = &mmss_mmssnoc_bto_ahb_clk.clkr,
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 2/16 MIPS: Fix a compilation issue
From: xurui <[email protected]>
[ Upstream commit 109d587a4b4d7ccca2200ab1f808f43ae23e2585 ]
arch/mips/include/asm/mach-rc32434/pci.h:377:
cc1: error: result of ‘-117440512 << 16’ requires 44 bits to represent, but ‘int’ only has 32 bits [-Werror=shift-overflow=]
All bits in KORINA_STAT are already at the correct position, so there is no addtional shift needed.
--- arch/mips/include/asm/mach-rc32434/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/mach-rc32434/pci.h +1 -1
@@ -374,7 +374,7 @@ struct pci_msu { PCI_CFG04_STAT_SSE | \ PCI_CFG04_STAT_PE) -#define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD) +#define KORINA_CNFG1 (KORINA_STAT | KORINA_CMD)#define KORINA_REVID 0#define KORINA_CLASS_CODE 0
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 3/16 powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ
In reply to Sasha LevinFrom: Christophe Leroy <[email protected]>
[ Upstream commit bab537805a10bdbf55b31324ba4a9599e0651e5e ]
NO_IRQ is a relic from the old days. It is not used anymore in core functions. By the way, function irq_of_parse_and_map() returns value 0 on error.
In some drivers, NO_IRQ is erroneously used to check the return of irq_of_parse_and_map().
It is not a real bug today because the only architectures using the drivers being fixed by this patch define NO_IRQ as 0, but there are architectures which define NO_IRQ as -1. If one day those architectures start using the non fixed drivers, there will be a problem.
Long time ago Linus advocated for not using NO_IRQ, see
https://lore.kernel.org/all/[email protected]
He re-iterated the same view recently in
https://lore.kernel.org/all/CAHk-=wg2Pkb9kbfbstbB91AJA2SF6cySbsgHG-iQMq56j3VTcA@mail.gmail.com
So test !irq instead of tesing irq == NO_IRQ.
All other usage of NO_IRQ for powerpc were removed in previous cycles so the time has come to remove NO_IRQ completely for powerpc.
--- arch/powerpc/include/asm/irq.h | 3 --- arch/powerpc/platforms/44x/fsp2.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-)
arch/powerpc/include/asm/irq.h +0 -3
@@ -16,9 +16,6 @@extern atomic_t ppc_n_lost_interrupts; -/* This number is used when no interrupt has been assigned */ -#define NO_IRQ (0) -/* Total number of virq in the platform */ #define NR_IRQS CONFIG_NR_IRQS
arch/powerpc/platforms/44x/fsp2.c +1 -1
@@ -205,7 +205,7 @@ static void __init node_irq_request(const char *compat, irq_handler_t errirq_hanfor_each_compatible_node (np,NULL , compat) { irq =irq_of_parse_and_map (np,0 ); -if (irq ==NO_IRQ ) { +if (!irq) {pr_err ("device tree node %pOFn is missing a interrupt" , np);of_node_put (np);
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 4/16 powerpc/64: Don't recurse irq replay
In reply to Sasha LevinFrom: Nicholas Piggin <[email protected]>
[ Upstream commit 5746ca131e2496ccd5bb4d7a0244d6c38070cbf5 ]
Interrupt handlers called by soft-pending irq replay code can run softirqs, softirq replay enables and disables local irqs, which allows interrupts to come in including soft-masked interrupts, and it can cause pending irqs to be replayed again. That makes the soft irq replay state machine and possible races more complicated and fragile than it needs to be.
Use irq_enter/irq_exit around irq replay to prevent softirqs running while interrupts are being replayed. Softirqs will now be run at the irq_exit() call after all the irq replaying is done. This prevents irqs being replayed while irqs are being replayed, and should hopefully make things simpler and easier to think about and debug.
A new PACA_IRQ_REPLAYING is added to prevent asynchronous interrupt handlers hard-enabling EE while pending irqs are being replayed, because that causes new pending irqs to arrive which is also a complexity. This means pending irqs won't be profiled quite so well because perf irqs can't be taken.
--- arch/powerpc/include/asm/hw_irq.h | 6 +- arch/powerpc/kernel/irq_64.c | 101 +++++++++++++++++++----------- 2 files changed, 70 insertions(+), 37 deletions(-)
arch/powerpc/include/asm/hw_irq.h +4 -2
@@ -36,15 +36,17 @@#define PACA_IRQ_DEC 0x08/* Or FIT */ #define PACA_IRQ_HMI 0x10#define PACA_IRQ_PMI 0x20 +#define PACA_IRQ_REPLAYING 0x40/* * Some soft-masked interrupts must be hard masked until they are replayed * (e.g., because the soft-masked handler does not clear the exception). +* Interrupt replay itself must remain hard masked too. */ #ifdef CONFIG_PPC_BOOK3S -#define PACA_IRQ_MUST_HARD_MASK (PACA_IRQ_EE|PACA_IRQ_PMI) +#define PACA_IRQ_MUST_HARD_MASK (PACA_IRQ_EE|PACA_IRQ_PMI|PACA_IRQ_REPLAYING)#else -#define PACA_IRQ_MUST_HARD_MASK (PACA_IRQ_EE) +#define PACA_IRQ_MUST_HARD_MASK (PACA_IRQ_EE|PACA_IRQ_REPLAYING)#endif #endif /* CONFIG_PPC64 */
arch/powerpc/kernel/irq_64.c +66 -35
182 lines not on this page · raw message
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 5/16 s390/virtio: sort out physical vs virtual pointers usage
In reply to Sasha LevinFrom: Alexander Gordeev <[email protected]>
[ Upstream commit 5fc5b94a273655128159186c87662105db8afeb5 ]
This does not fix a real bug, since virtual addresses are currently indentical to physical ones.
--- drivers/s390/virtio/virtio_ccw.c | 46 +++++++++++++++++--------------- 1 file changed, 24 insertions(+), 22 deletions(-)
drivers/s390/virtio/virtio_ccw.c +24 -22
@@ -363,7 +363,7 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device *vcdev, thinint_area->isc =VIRTIO_AIRQ_ISC ; ccw->cmd_code =CCW_CMD_SET_IND_ADAPTER ; ccw->count =sizeof (*thinint_area); - ccw->cda = (__u32 )(unsigned long ) thinint_area; + ccw->cda = (__u32 )virt_to_phys (thinint_area); }else {/* payload is the address of the indicators */ indicatorp = ccw_device_dma_zalloc(vcdev->cdev,
@@ -373,7 +373,7 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device *vcdev, *indicatorp =0 ; ccw->cmd_code =CCW_CMD_SET_IND ; ccw->count =sizeof (indicators (vcdev)); - ccw->cda = (__u32 )(unsigned long ) indicatorp; + ccw->cda = (__u32 )virt_to_phys (indicatorp); }/* Deregister indicators from host. */ *indicators (vcdev) =0 ;
@@ -417,7 +417,7 @@ static int virtio_ccw_read_vq_conf(struct virtio_ccw_device *vcdev, ccw->cmd_code =CCW_CMD_READ_VQ_CONF ; ccw->flags =0 ; ccw->count =sizeof (struct vq_config_block ); - ccw->cda = (__u32 )(unsigned long )(&vcdev->dma_area->config_block); + ccw->cda = (__u32 )virt_to_phys (&vcdev->dma_area->config_block); ret =ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_READ_VQ_CONF );if (ret)return ret;
@@ -454,7 +454,7 @@ static void virtio_ccw_del_vq(struct virtqueue *vq, struct ccw1 *ccw) } ccw->cmd_code =CCW_CMD_SET_VQ ; ccw->flags =0 ; - ccw->cda = (__u32 )(unsigned long )(info->info_block); + ccw->cda = (__u32 )virt_to_phys (info->info_block); ret =ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_SET_VQ | index);/*
@@ -556,7 +556,7 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev, } ccw->cmd_code =CCW_CMD_SET_VQ ; ccw->flags =0 ; - ccw->cda = (__u32 )(unsigned long )(info->info_block); + ccw->cda = (__u32 )virt_to_phys (info->info_block); err =ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_SET_VQ | i);if (err) {dev_warn (&vcdev->cdev->dev,"SET_VQ failed\n" );
@@ -590,6 +590,7 @@ static int virtio_ccw_register_adapter_ind(struct virtio_ccw_device *vcdev, {int ret;struct virtio_thinint_area *thinint_area =NULL ; +unsigned long indicator_addr;struct airq_info *info; thinint_area = ccw_device_dma_zalloc(vcdev->cdev,
@@ -599,21 +600,22 @@ static int virtio_ccw_register_adapter_ind(struct virtio_ccw_device *vcdev, goto out; }/* Try to get an indicator. */ - thinint_area->indicator =get_airq_indicator (vqs, nvqs, - &thinint_area->bit_nr, - &vcdev->airq_info); -if (!thinint_area->indicator) { + indicator_addr =get_airq_indicator (vqs, nvqs, + &thinint_area->bit_nr, + &vcdev->airq_info); +if (!indicator_addr) { ret = -ENOSPC ; goto out; } + thinint_area->indicator =virt_to_phys ((void *)indicator_addr); info = vcdev->airq_info; thinint_area->summary_indicator = - (unsigned long )get_summary_indicator (info); +virt_to_phys (get_summary_indicator (info)); thinint_area->isc =VIRTIO_AIRQ_ISC ; ccw->cmd_code =CCW_CMD_SET_IND_ADAPTER ; ccw->flags =CCW_FLAG_SLI ; ccw->count =sizeof (*thinint_area); - ccw->cda = (__u32 )(unsigned long )thinint_area; + ccw->cda = (__u32 )virt_to_phys (thinint_area); ret =ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_SET_IND_ADAPTER );if (ret) {if (ret == -EOPNOTSUPP ) {
@@ -686,7 +688,7 @@ static int virtio_ccw_find_vqs(struct virtio_device *vdev, unsigned nvqs, ccw->cmd_code =CCW_CMD_SET_IND ; ccw->flags =0 ; ccw->count =sizeof (indicators (vcdev)); - ccw->cda = (__u32 )(unsigned long ) indicatorp; + ccw->cda = (__u32 )virt_to_phys (indicatorp); ret =ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_SET_IND );if (ret) goto out;
@@ -697,7 +699,7 @@ static int virtio_ccw_find_vqs(struct virtio_device *vdev, unsigned nvqs, ccw->cmd_code =CCW_CMD_SET_CONF_IND ; ccw->flags =0 ; ccw->count =sizeof (indicators2 (vcdev)); - ccw->cda = (__u32 )(unsigned long ) indicatorp; + ccw->cda = (__u32 )virt_to_phys (indicatorp); ret =ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_SET_CONF_IND );if (ret) goto out;
@@ -759,7 +761,7 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev) ccw->cmd_code =CCW_CMD_READ_FEAT ; ccw->flags =0 ; ccw->count =sizeof (*features); - ccw->cda = (__u32 )(unsigned long )features; + ccw->cda = (__u32 )virt_to_phys (features); ret =ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_READ_FEAT );if (ret) { rc =0 ;
@@ -776,7 +778,7 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev) ccw->cmd_code =CCW_CMD_READ_FEAT ; ccw->flags =0 ; ccw->count =sizeof (*features); - ccw->cda = (__u32 )(unsigned long )features; + ccw->cda = (__u32 )virt_to_phys (features); ret =ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_READ_FEAT );if (ret ==0 ) rc |= (u64 )le32_to_cpu (features->features) <<32 ;
@@ -829,7 +831,7 @@ static int virtio_ccw_finalize_features(struct virtio_device *vdev) ccw->cmd_code =CCW_CMD_WRITE_FEAT ; ccw->flags =0 ; ccw->count =sizeof (*features); - ccw->cda = (__u32 )(unsigned long )features; + ccw->cda = (__u32 )virt_to_phys (features); ret =ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_WRITE_FEAT );if (ret) goto out_free;
@@ -843,7 +845,7 @@ static int virtio_ccw_finalize_features(struct virtio_device *vdev) ccw->cmd_code =CCW_CMD_WRITE_FEAT ; ccw->flags =0 ; ccw->count =sizeof (*features); - ccw->cda = (__u32 )(unsigned long )features; + ccw->cda = (__u32 )virt_to_phys (features); ret =ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_WRITE_FEAT ); out_free:
@@ -875,7 +877,7 @@ static void virtio_ccw_get_config(struct virtio_device *vdev, ccw->cmd_code =CCW_CMD_READ_CONF ; ccw->flags =0 ; ccw->count = offset + len; - ccw->cda = (__u32 )(unsigned long )config_area; + ccw->cda = (__u32 )virt_to_phys (config_area); ret =ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_READ_CONFIG );if (ret) goto out_free;
@@ -922,7 +924,7 @@ static void virtio_ccw_set_config(struct virtio_device *vdev, ccw->cmd_code =CCW_CMD_WRITE_CONF ; ccw->flags =0 ; ccw->count = offset + len; - ccw->cda = (__u32 )(unsigned long )config_area; + ccw->cda = (__u32 )virt_to_phys (config_area);ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_WRITE_CONFIG ); out_free:
@@ -946,7 +948,7 @@ static u8 virtio_ccw_get_status(struct virtio_device *vdev) ccw->cmd_code =CCW_CMD_READ_STATUS ; ccw->flags =0 ; ccw->count =sizeof (vcdev->dma_area->status); - ccw->cda = (__u32 )(unsigned long )&vcdev->dma_area->status; + ccw->cda = (__u32 )virt_to_phys (&vcdev->dma_area->status);ccw_io_helper (vcdev, ccw,VIRTIO_CCW_DOING_READ_STATUS );/* * If the channel program failed (should only happen if the device
@@ -975,7 +977,7 @@ static void virtio_ccw_set_status(struct virtio_device *vdev, u8 status) ccw->cmd_code =CCW_CMD_WRITE_STATUS ; ccw->flags =0 ; ccw->count =sizeof (status); - ccw->cda = (__u32 )(unsigned long )&vcdev->dma_area->status; + ccw->cda = (__u32 )virt_to_phys (&vcdev->dma_area->status);/* We use ssch for setting the status which is a serializing * instruction that guarantees the memory writes have * completed before ssch.
@@ -1274,7 +1276,7 @@ static int virtio_ccw_set_transport_rev(struct virtio_ccw_device *vcdev) ccw->cmd_code =CCW_CMD_SET_VIRTIO_REV ; ccw->flags =0 ; ccw->count =sizeof (*rev); - ccw->cda = (__u32 )(unsigned long )rev; + ccw->cda = (__u32 )virt_to_phys (rev); vcdev->revision =VIRTIO_CCW_REV_MAX ; do {
Signature · 6 lines
2.39.2 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH AUTOSEL 6.2 05/16] s390/virtio: sort out physical vs virtual pointers usage
Hi Sasha, s390 maintainers,
Quoting Sasha Levin (2023-03-05 14:51:56)
Quoted 6 lines
From: Alexander Gordeev <[email protected]>
[ Upstream commit
5fc5b94a273655128159186c87662105db8afeb5]This does not fix a real bug, since virtual addresses are currently indentical to physical ones.
not sure if it is appropriate to pick for stable, since it does not fix a bug currently.
Alexander, Janosch, your opinion?
Sasha Levin
maintainerRe: [PATCH AUTOSEL 6.2 05/16] s390/virtio: sort out physical vs virtual pointers usage
Quoted 5 lines · Nico Boehr
Hi Sasha, s390 maintainers,
Quoting Sasha Levin (2023-03-05 14:51:56)
Quoted 2 lines
From: Alexander Gordeev <[email protected]>
Quoted 8 lines
Quoted 4 lines
[ Upstream commit
5fc5b94a273655128159186c87662105db8afeb5]This does not fix a real bug, since virtual addresses are currently indentical to physical ones.
not sure if it is appropriate to pick for stable, since it does not fix a bug currently.
Alexander, Janosch, your opinion?
I'll drop it, thanks!
Signature · 2 lines
Thanks, Sasha
Sasha Levin
maintainerPATCH 6/16 powerpc/iommu: fix memory leak with using debugfs_lookup()
In reply to Sasha LevinFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit b505063910c134778202dfad9332dfcecb76bab3 ]
When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler, just call debugfs_lookup_and_remove() instead which handles all of the logic at once.
--- arch/powerpc/kernel/iommu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/powerpc/kernel/iommu.c +1 -3
@@ -67,11 +67,9 @@ static void iommu_debugfs_add(struct iommu_table *tbl)static void iommu_debugfs_del (struct iommu_table *tbl) {char name[10 ]; -struct dentry *liobn_entry;sprintf (name,"%08lx" , tbl->it_index); - liobn_entry =debugfs_lookup (name, iommu_debugfs_dir); -debugfs_remove (liobn_entry); +debugfs_lookup_and_remove (name, iommu_debugfs_dir); }#else static void iommu_debugfs_add (struct iommu_table *tbl){}
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 7/16 clk: renesas: rcar-gen3: Disable R-Car H3 ES1.*
In reply to Sasha LevinFrom: Wolfram Sang <[email protected]>
[ Upstream commit b1dec4e78599a2ce5bf8557056cd6dd72e1096b0 ]
R-Car H3 ES1.* was only available to an internal development group and needed a lot of quirks and workarounds. These become a maintenance burden now, so our development group decided to remove upstream support for this SoC. Public users only have ES2 onwards.
In addition to the ES1 specific removals, a check for it was added preventing the machine to boot further. It may otherwise inherit wrong clock settings from ES2 which could damage the hardware.
--- drivers/clk/renesas/Kconfig | 2 +- drivers/clk/renesas/r8a7795-cpg-mssr.c | 126 ++----------------------- drivers/clk/renesas/rcar-gen3-cpg.c | 17 +--- drivers/clk/renesas/renesas-cpg-mssr.c | 27 ------ drivers/clk/renesas/renesas-cpg-mssr.h | 14 --- 5 files changed, 13 insertions(+), 173 deletions(-)
drivers/clk/renesas/Kconfig +1 -1
@@ -22,7 +22,7 @@ config CLK_RENESAS select CLK_R8A7791 if ARCH_R8A7791 || ARCH_R8A7793 select CLK_R8A7792 if ARCH_R8A7792 select CLK_R8A7794 if ARCH_R8A7794 - select CLK_R8A7795 if ARCH_R8A77950 || ARCH_R8A77951 + select CLK_R8A7795 if ARCH_R8A77951 select CLK_R8A77960 if ARCH_R8A77960 select CLK_R8A77961 if ARCH_R8A77961 select CLK_R8A77965 if ARCH_R8A77965
drivers/clk/renesas/r8a7795-cpg-mssr.c +10 -116
187 lines not on this page · raw message
drivers/clk/renesas/rcar-gen3-cpg.c +2 -15
@@ -310,19 +310,10 @@ static unsigned int cpg_clk_extalr __initdata;static u32 cpg_mode__initdata ;static u32 cpg_quirks__initdata ; -#define PLL_ERRATA BIT(0)/* Missing PLL0/2/4 post-divider */ #define RCKCR_CKSEL BIT(1)/* Manual RCLK parent selection */ static const struct soc_device_attribute cpg_quirks_match[]__initconst = { - { - .soc_id ="r8a7795" , .revision ="ES1.0" , - .data = (void *)(PLL_ERRATA |RCKCR_CKSEL ), - }, - { - .soc_id ="r8a7795" , .revision ="ES1.*" , - .data = (void *)(RCKCR_CKSEL ), - }, { .soc_id ="r8a7796" , .revision ="ES1.0" , .data = (void *)(RCKCR_CKSEL ),
@@ -355,9 +346,8 @@ struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev,* multiplier when cpufreq changes between normal and boost * modes. */ - mult = (cpg_quirks &PLL_ERRATA ) ?4 :2 ;return cpg_pll_clk_register (core->name,__clk_get_name (parent), - base, mult,CPG_PLL0CR ,0 ); + base,2 ,CPG_PLL0CR ,0 );case CLK_TYPE_GEN3_PLL1 : mult = cpg_pll_config->pll1_mult;
@@ -370,9 +360,8 @@ struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev,* multiplier when cpufreq changes between normal and boost * modes. */ - mult = (cpg_quirks &PLL_ERRATA ) ?4 :2 ;return cpg_pll_clk_register (core->name,__clk_get_name (parent), - base, mult,CPG_PLL2CR ,2 ); + base,2 ,CPG_PLL2CR ,2 );case CLK_TYPE_GEN3_PLL3 : mult = cpg_pll_config->pll3_mult;
@@ -388,8 +377,6 @@ struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev,*/ value =readl (base +CPG_PLL4CR ); mult = (((value >>24 ) &0x7f ) +1 ) *2 ; -if (cpg_quirks &PLL_ERRATA ) - mult *=2 ;break ;case CLK_TYPE_GEN3_SDH :
drivers/clk/renesas/renesas-cpg-mssr.c +0 -27
@@ -1113,19 +1113,6 @@ static int __init cpg_mssr_init(void)subsys_initcall (cpg_mssr_init); -void __init cpg_core_nullify_range (struct cpg_core_clk *core_clks, -unsigned int num_core_clks, -unsigned int first_clk, -unsigned int last_clk) -{ -unsigned int i; - -for (i =0 ; i < num_core_clks; i++) -if (core_clks[i].id >= first_clk && - core_clks[i].id <= last_clk) - core_clks[i].name =NULL ; -} -void __init mssr_mod_nullify (struct mssr_mod_clk *mod_clks,unsigned int num_mod_clks,const unsigned int *clks,unsigned int n)
@@ -1139,19 +1126,5 @@ void __init mssr_mod_nullify(struct mssr_mod_clk *mod_clks, } } -void __init mssr_mod_reparent (struct mssr_mod_clk *mod_clks, -unsigned int num_mod_clks, -const struct mssr_mod_reparent *clks, -unsigned int n) -{ -unsigned int i, j; - -for (i =0 , j =0 ; i < num_mod_clks && j < n; i++) -if (mod_clks[i].id == clks[j].clk) { - mod_clks[i].parent = clks[j].parent; - j++; - } -} -MODULE_DESCRIPTION ("Renesas CPG/MSSR Driver" );MODULE_LICENSE ("GPL v2" );
drivers/clk/renesas/renesas-cpg-mssr.h +0 -14
@@ -187,21 +187,7 @@ void __init cpg_mssr_early_init(struct device_node *np,/* * Helpers for fixing up clock tables depending on SoC revision */ - -struct mssr_mod_reparent { -unsigned int clk, parent; -}; - - -extern void cpg_core_nullify_range (struct cpg_core_clk *core_clks, -unsigned int num_core_clks, -unsigned int first_clk, -unsigned int last_clk);extern void mssr_mod_nullify (struct mssr_mod_clk *mod_clks,unsigned int num_mod_clks,const unsigned int *clks,unsigned int n); -extern void mssr_mod_reparent (struct mssr_mod_clk *mod_clks, -unsigned int num_mod_clks, -const struct mssr_mod_reparent *clks, -unsigned int n);#endif
Signature · 1 line
2.39.2
Re: [PATCH AUTOSEL 6.2 07/16] clk: renesas: rcar-gen3: Disable R-Car H3 ES1.*
Hi Sasha,
Quoted 13 lines · Sasha Levin
From: Wolfram Sang <[email protected]>
[ Upstream commit
b1dec4e78599a2ce5bf8557056cd6dd72e1096b0]R-Car H3 ES1.* was only available to an internal development group and needed a lot of quirks and workarounds. These become a maintenance burden now, so our development group decided to remove upstream support for this SoC. Public users only have ES2 onwards.
In addition to the ES1 specific removals, a check for it was added preventing the machine to boot further. It may otherwise inherit wrong clock settings from ES2 which could damage the hardware.
Quoted 5 lines
Signed-off-by Wolfram Sang <[email protected]>Reviewed-by Geert Uytterhoeven <[email protected]>Signed-off-by Geert Uytterhoeven <[email protected]>Signed-off-by Sasha Levin <[email protected]>
This patch disables hardware support. Do we really want to backport that to stable?
Perhaps backporting to v6.2.y and v6.1.y is still acceptable (the next Renesas BSP will be based on v6.1.y LTS), but I would not recommend backporting to older versions.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Sasha Levin
maintainerRe: [PATCH AUTOSEL 6.2 07/16] clk: renesas: rcar-gen3: Disable R-Car H3 ES1.*
Quoted 22 lines · Geert Uytterhoeven
Hi Sasha,
Quoted 13 lines · Sasha Levin
From: Wolfram Sang <[email protected]>
[ Upstream commit
b1dec4e78599a2ce5bf8557056cd6dd72e1096b0]R-Car H3 ES1.* was only available to an internal development group and needed a lot of quirks and workarounds. These become a maintenance burden now, so our development group decided to remove upstream support for this SoC. Public users only have ES2 onwards.
In addition to the ES1 specific removals, a check for it was added preventing the machine to boot further. It may otherwise inherit wrong clock settings from ES2 which could damage the hardware.
Quoted 5 lines
Signed-off-by Wolfram Sang <[email protected]>Reviewed-by Geert Uytterhoeven <[email protected]>Signed-off-by Geert Uytterhoeven <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Quoted 5 lines
This patch disables hardware support. Do we really want to backport that to stable?
Perhaps backporting to v6.2.y and v6.1.y is still acceptable (the next Renesas BSP will be based on v6.1.y LTS), but I would not recommend backporting to older versions.
Ack, I'll drop it from older trees. Thanks!
Signature · 2 lines
Thanks, Sasha
Sasha Levin
maintainerPATCH 8/16 powerpc: Remove __kernel_text_address() in show_instructions()
In reply to Sasha LevinFrom: Christophe Leroy <[email protected]>
[ Upstream commit d9ab6da64fd15608c9feb20d769d8df1a32fe212 ]
That test was introducted in 2006 by
commit 00ae36de49cc ("[POWERPC] Better check in show_instructions"). At that time, there was no BPF progs.
As seen in message of commit 89d21e259a94 ("powerpc/bpf/32: Fix Oops on tail call tests"), when a page fault occurs in test_bpf.ko for instance, the code is dumped as XXXXXXXXs. Allthough __kernel_text_address() checks is_bpf_text_address(), it seems it is not enough.
Today, show_instructions() uses get_kernel_nofault() to read the code, so there is no real need for additional verifications.
ARM64 and x86 don't do any additional check before dumping instructions. Do the same and remove __kernel_text_address() in show_instructions().
--- arch/powerpc/kernel/process.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/kernel/process.c +1 -2
@@ -1405,8 +1405,7 @@ static void show_instructions(struct pt_regs *regs)for (i =0 ; i <NR_INSN_TO_PRINT ; i++) {int instr; -if (!__kernel_text_address (pc) || -get_kernel_nofault (instr, (const void *)pc)) { +if (get_kernel_nofault (instr, (const void *)pc)) {pr_cont ("XXXXXXXX " ); }else {if (nip == pc)
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 9/16 powerpc/bpf/32: Only set a stack frame when necessary
In reply to Sasha LevinFrom: Christophe Leroy <[email protected]>
[ Upstream commit d084dcf256bc4565b4b1af9b00297ac7b51c7049 ]
Until now a stack frame was set at all time due to the need to keep tail call counter in the stack.
But since commit 89d21e259a94 ("powerpc/bpf/32: Fix Oops on tail call tests") the tail call counter is passed via register r4. It is therefore not necessary anymore to have a stack frame for that.
Just like PPC64, implement bpf_has_stack_frame() and only sets the frame when needed.
The difference with PPC64 is that PPC32 doesn't have a redzone, so the stack is required as soon as non volatile registers are used or when tail call count is set up.
--- arch/powerpc/net/bpf_jit_comp32.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
arch/powerpc/net/bpf_jit_comp32.c +18 -2
@@ -79,6 +79,20 @@ static int bpf_jit_stack_offsetof(struct codegen_context *ctx, int reg)#define SEEN_NVREG_FULL_MASK 0x0003ffff/* Non volatile registers r14-r31 */ #define SEEN_NVREG_TEMP_MASK 0x00001e01/* BPF_REG_5, BPF_REG_AX, TMP_REG */ +static inline bool bpf_has_stack_frame (struct codegen_context *ctx) +{ +/* +* We only need a stack frame if: +* - we call other functions (kernel helpers), or +* - we use non volatile registers, or +* - we use tail call counter +* - the bpf program uses its stack area +* The latter condition is deduced from the usage of BPF_REG_FP +*/ +return ctx->seen & (SEEN_FUNC |SEEN_TAILCALL |SEEN_NVREG_FULL_MASK ) || +bpf_is_seen_register (ctx,bpf_to_ppc (BPF_REG_FP )); +} +void bpf_jit_realloc_regs (struct codegen_context *ctx) {unsigned int nvreg_mask;
@@ -118,7 +132,8 @@ void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx)#define BPF_TAILCALL_PROLOGUE_SIZE 4 -EMIT (PPC_RAW_STWU (_R1, _R1, -BPF_PPC_STACKFRAME (ctx))); +if (bpf_has_stack_frame (ctx)) +EMIT (PPC_RAW_STWU (_R1, _R1, -BPF_PPC_STACKFRAME (ctx)));if (ctx->seen &SEEN_TAILCALL )EMIT (PPC_RAW_STW (_R4, _R1,bpf_jit_stack_offsetof (ctx,BPF_PPC_TC )));
@@ -171,7 +186,8 @@ static void bpf_jit_emit_common_epilogue(u32 *image, struct codegen_context *ctxEMIT (PPC_RAW_LWZ (_R0, _R1,BPF_PPC_STACKFRAME (ctx) +PPC_LR_STKOFF ));/* Tear down our stack frame */ -EMIT (PPC_RAW_ADDI (_R1, _R1,BPF_PPC_STACKFRAME (ctx))); +if (bpf_has_stack_frame (ctx)) +EMIT (PPC_RAW_ADDI (_R1, _R1,BPF_PPC_STACKFRAME (ctx)));if (ctx->seen &SEEN_FUNC )EMIT (PPC_RAW_MTLR (_R0));
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 10/16 powerpc/64: Fix task_cpu in early boot when booting non-zero cpuid
In reply to Sasha LevinFrom: Nicholas Piggin <[email protected]>
[ Upstream commit 9fa24404f5044967753a6cd3e5e36f57686bec6e ]
powerpc/64 can boot on a non-zero SMP processor id. Initially, the boot CPU is said to be "assumed to be 0" until early_init_devtree() discovers the id from the device tree. That is not a good description because the assumption can be wrong and that has to be handled, the better description is that 0 is used as a placeholder, and things are fixed after the real id is discovered.
smp_processor_id() is set to the boot cpuid, but task_cpu(current) is not, which causes the smp_processor_id() == task_cpu(current) invariant to be broken until init_idle() in sched_init().
This is quite fragile and could lead to subtle bugs in future. One bug is that validate_sp_size uses task_cpu() to get the process stack, so any stack trace from the booting CPU between early_init_devtree() and sched_init() will have problems. Early on paca_ptrs[0] will be poisoned, so that can cause machine checks dereferencing that memory in real mode. Later, validating the current stack pointer against the idle task of a different secondary will probably cause no stack trace to be printed.
Fix this by setting thread_info->cpu right after smp_processor_id() is set to the boot cpuid.
--- arch/powerpc/kernel/setup_64.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/powerpc/kernel/setup_64.c +5 -0
@@ -396,6 +396,11 @@ void __init early_setup(unsigned long dt_ptr) }fixup_boot_paca (paca_ptrs[boot_cpuid]);setup_paca (paca_ptrs[boot_cpuid]);/* install the paca into registers */ +// smp_processor_id() now reports boot_cpuid + +#ifdef CONFIG_SMP +task_thread_info (current)->cpu = boot_cpuid;// fix task_cpu(current) +#endif /* * Configure exception handlers. This include setting up trampolines
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 11/16 powerpc/64: Move paca allocation to early_setup()
In reply to Sasha LevinFrom: Nicholas Piggin <[email protected]>
[ Upstream commit dc222fa7737212fe0da513e5b8937c156d02225d ]
The early paca and boot cpuid dance is complicated and currently does not quite work as expected for boot cpuid != 0 cases.
early_init_devtree() currently allocates the paca_ptrs and boot cpuid paca, but until that returns and early_setup() calls setup_paca(), this thread is currently still executing with smp_processor_id() == 0.
One problem this causes is the paca_ptrs[smp_processor_id()] pointer is poisoned, so valid_emergency_stack() (any backtrace) and any similar users will crash.
Another is that the hardware id which is set here will not be returned by get_hard_smp_processor_id(smp_processor_id()), but it would work correctly for boot_cpuid == 0, which could lead to difficult to reproduce or find bugs. The hard id does not seem to be used by the rest of early_init_devtree(), it just looks like all this code might have been put here to allocate somewhere to store boot CPU hardware id while scanning the devtree.
Rearrange things so the hwid is put in a global variable like boot_cpuid, and do all the paca allocation and boot paca setup in the 64-bit early_setup() after we have everything ready to go.
The paca_ptrs[0] re-poisoning code in early_setup does not seem to have ever worked, because paca_ptrs[0] was never not-poisoned when boot_cpuid is not 0.
--- arch/powerpc/include/asm/paca.h | 1 - arch/powerpc/include/asm/smp.h | 1 + arch/powerpc/kernel/prom.c | 12 +++--------- arch/powerpc/kernel/setup-common.c | 4 ++++ arch/powerpc/kernel/setup_64.c | 11 +++++------ 5 files changed, 13 insertions(+), 16 deletions(-)
arch/powerpc/include/asm/paca.h +0 -1
@@ -295,7 +295,6 @@ extern void free_unused_pacas(void);#else /* CONFIG_PPC64 */ -static inline void allocate_paca_ptrs (void ) { }static inline void allocate_paca (int cpu) { }static inline void free_unused_pacas (void ) { }
arch/powerpc/include/asm/smp.h +1 -0
@@ -26,6 +26,7 @@#include <asm/percpu.h> extern int boot_cpuid; +extern int boot_cpu_hwid;/* PPC64 only */ extern int spinning_secondaries;extern u32 *cpu_to_phys_id;extern bool coregroup_enabled;
arch/powerpc/kernel/prom.c +3 -9
@@ -370,8 +370,8 @@ static int __init early_init_dt_scan_cpus(unsigned long node, be32_to_cpu(intserv[found_thread])); boot_cpuid = found; -// Pass the boot CPU's hard CPU id back to our caller - *((u32 *)data) =be32_to_cpu (intserv[found_thread]); +if (IS_ENABLED (CONFIG_PPC64 )) + boot_cpu_hwid =be32_to_cpu (intserv[found_thread]);/* * PAPR defines "logical" PVR values for cpus that
@@ -755,7 +755,6 @@ static inline void save_fscr_to_task(void) {}void __init early_init_devtree (void *params) { -u32 boot_cpu_hwid;phys_addr_t limit;DBG (" -> early_init_devtree(%px)\n" , params);
@@ -851,7 +850,7 @@ void __init early_init_devtree(void *params)/* Retrieve CPU related informations from the flat tree * (altivec support, boot CPU ID, ...) */ -of_scan_flat_dt (early_init_dt_scan_cpus, &boot_cpu_hwid); +of_scan_flat_dt (early_init_dt_scan_cpus,NULL );if (boot_cpuid <0 ) {printk ("Failed to identify boot CPU !\n" );BUG ();
@@ -868,11 +867,6 @@ void __init early_init_devtree(void *params)mmu_early_init_devtree (); -// NB. paca is not installed until later in early_setup() -allocate_paca_ptrs (); -allocate_paca (boot_cpuid); -set_hard_smp_processor_id (boot_cpuid, boot_cpu_hwid); -#ifdef CONFIG_PPC_POWERNV /* Scan and build the list of machine check recoverable ranges */ of_scan_flat_dt (early_init_dt_scan_recoverable_ranges,NULL );
arch/powerpc/kernel/setup-common.c +4 -0
@@ -87,6 +87,10 @@ EXPORT_SYMBOL(machine_id);int boot_cpuid =-1 ;EXPORT_SYMBOL_GPL (boot_cpuid); +#ifdef CONFIG_PPC64 +int boot_cpu_hwid =-1 ; +#endif +/* * These are used in binfmt_elf.c to put aux entries on the stack * for each elf executable being started.
arch/powerpc/kernel/setup_64.c +5 -6
@@ -385,15 +385,14 @@ void __init early_setup(unsigned long dt_ptr)/* * Do early initialization using the flattened device * tree, such as retrieving the physical memory map or -* calculating/retrieving the hash table size. +* calculating/retrieving the hash table size, discover +* boot_cpuid and boot_cpu_hwid. */ early_init_devtree (__va (dt_ptr)); -/* Now we know the logical id of our boot cpu, setup the paca. */ -if (boot_cpuid !=0 ) { -/* Poison paca_ptrs[0] again if it's not the boot cpu */ -memset (&paca_ptrs[0 ],0x88 ,sizeof (paca_ptrs[0 ])); - } +allocate_paca_ptrs (); +allocate_paca (boot_cpuid); +set_hard_smp_processor_id (boot_cpuid, boot_cpu_hwid);fixup_boot_paca (paca_ptrs[boot_cpuid]);setup_paca (paca_ptrs[boot_cpuid]);/* install the paca into registers */ // smp_processor_id() now reports boot_cpuid
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 12/16 powerpc/kcsan: Exclude udelay to prevent recursive instrumentation
In reply to Sasha LevinFrom: Rohan McLure <[email protected]>
[ Upstream commit 2a7ce82dc46c591c9244057d89a6591c9639b9b9 ]
In order for KCSAN to increase its likelihood of observing a data race, it sets a watchpoint on memory accesses and stalls, allowing for detection of conflicting accesses by other kernel threads or interrupts.
Stalls are implemented by injecting a call to udelay in instrumented code. To prevent recursive instrumentation, exclude udelay from being instrumented.
--- arch/powerpc/kernel/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/time.c +2 -2
@@ -356,7 +356,7 @@ void vtime_flush(struct task_struct *tsk) }#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ -void __delay (unsigned long loops) +void __no_kcsan __delay(unsigned long loops) {unsigned long start;
@@ -377,7 +377,7 @@ void __delay(unsigned long loops) }EXPORT_SYMBOL (__delay); -void udelay (unsigned long usecs) +void __no_kcsan udelay(unsigned long usecs) {__delay (tb_ticks_per_usec * usecs); }
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 13/16 alpha: fix R_ALPHA_LITERAL reloc for large modules
In reply to Sasha LevinFrom: Edward Humes <[email protected]>
[ Upstream commit b6b17a8b3ecd878d98d5472a9023ede9e669ca72 ]
Previously, R_ALPHA_LITERAL relocations would overflow for large kernel modules.
This was because the Alpha's apply_relocate_add was relying on the kernel's module loader to have sorted the GOT towards the very end of the module as it was mapped into memory in order to correctly assign the global pointer. While this behavior would mostly work fine for small kernel modules, this approach would overflow on kernel modules with large GOT's since the global pointer would be very far away from the GOT, and thus, certain entries would be out of range.
This patch fixes this by instead using the Tru64 behavior of assigning the global pointer to be 32KB away from the start of the GOT. The change made in this patch won't work for multi-GOT kernel modules as it makes the assumption the module only has one GOT located at the beginning of .got, although for the vast majority kernel modules, this should be fine. Of the kernel modules that would previously result in a relocation error, none of them, even modules like nouveau, have even come close to filling up a single GOT, and they've all worked fine under this patch.
--- arch/alpha/kernel/module.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/alpha/kernel/module.c +1 -3
@@ -146,10 +146,8 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab, base = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr; symtab = (Elf64_Sym *)sechdrs[symindex].sh_addr; -/* The small sections were sorted to the end of the segment. -The following should definitely cover them. */ - gp = (u64 )me->core_layout.base + me->core_layout.size -0x8000 ; got = sechdrs[me->arch.gotsecindex].sh_addr; + gp = got +0x8000 ;for (i =0 ; i < n; i++) {unsigned long r_sym =ELF64_R_SYM (rela[i].r_info);
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 14/16 macintosh: windfarm: Use unsigned type for 1-bit bitfields
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 748ea32d2dbd813d3bd958117bde5191182f909a ]
Clang warns:
drivers/macintosh/windfarm_lm75_sensor.c:63:14: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
lm->inited = 1;
^ ~ drivers/macintosh/windfarm_smu_sensors.c:356:19: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
pow->fake_volts = 1;
^ ~
drivers/macintosh/windfarm_smu_sensors.c:368:18: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
pow->quadratic = 1;
^ ~There is no bug here since no code checks the actual value of these fields, just whether or not they are zero (boolean context), but this can be easily fixed by switching to an unsigned type.
--- drivers/macintosh/windfarm_lm75_sensor.c | 4 ++-- drivers/macintosh/windfarm_smu_sensors.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/macintosh/windfarm_lm75_sensor.c +2 -2
@@ -33,8 +33,8 @@#endif struct wf_lm75_sensor { -int ds1775 :1 ; -int inited :1 ; +unsigned int ds1775 :1 ; +unsigned int inited :1 ;struct i2c_client *i2c;struct wf_sensor sens; };
drivers/macintosh/windfarm_smu_sensors.c +2 -2
@@ -274,8 +274,8 @@ struct smu_cpu_power_sensor {struct list_head link;struct wf_sensor *volts;struct wf_sensor *amps; - int fake_volts : 1; - int quadratic : 1; + unsigned int fake_volts : 1; + unsigned int quadratic : 1;struct wf_sensor sens; };#define to_smu_cpu_power (c) container_of(c, struct smu_cpu_power_sensor, sens)
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 15/16 PCI: Add SolidRun vendor ID
In reply to Sasha LevinFrom: Alvaro Karsz <[email protected]>
[ Upstream commit db6c4dee4c104f50ed163af71c53bfdb878a8318 ]
Add SolidRun vendor ID to pci_ids.h
The vendor ID is used in 2 different source files, the SNET vDPA driver and PCI quirks.
Message-Id: <[email protected]>
--- include/linux/pci_ids.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/pci_ids.h +2 -0
@@ -3092,6 +3092,8 @@#define PCI_VENDOR_ID_3COM_2 0xa727 +#define PCI_VENDOR_ID_SOLIDRUN 0xd063 +#define PCI_VENDOR_ID_DIGIUM 0xd161#define PCI_DEVICE_ID_DIGIUM_HFC4S 0xb410
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 16/16 PCI: Avoid FLR for SolidRun SNET DPU rev 1
In reply to Sasha LevinFrom: Alvaro Karsz <[email protected]>
[ Upstream commit d089d69cc1f824936eeaa4fa172f8fa1a0949eaa ]
This patch fixes a FLR bug on the SNET DPU rev 1 by setting the PCI_DEV_FLAGS_NO_FLR_RESET flag.
As there is a quirk to avoid FLR (quirk_no_flr), I added a new quirk to check the rev ID before calling to quirk_no_flr.
Without this patch, a SNET DPU rev 1 may hang when FLR is applied.
Message-Id: <[email protected]>
--- drivers/pci/quirks.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/pci/quirks.c +8 -0
@@ -5343,6 +5343,14 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x149c, quirk_no_flr);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x1502 , quirk_no_flr);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x1503 , quirk_no_flr); +/* FLR may cause the SolidRun SNET DPU (rev 0x1) to hang */ +static void quirk_no_flr_snet (struct pci_dev *dev) +{ +if (dev->revision ==0x1 ) +quirk_no_flr (dev); +} +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_SOLIDRUN ,0x1000 , quirk_no_flr_snet); +static void quirk_no_ext_tags (struct pci_dev *pdev) {struct pci_host_bridge *bridge =pci_find_host_bridge (pdev->bus);
Signature · 1 line
2.39.2