[PATCH v8 6/7] spmi: pmic-arb: Register controller for bus instead of arbiter

David Collins quic_collinsd at quicinc.com
Fri Apr 5 18:29:03 PDT 2024


On 4/2/24 05:07, Abel Vesa wrote:
> +struct spmi_pmic_arb_bus {
> +	struct spmi_pmic_arb	*pmic_arb;
> +	struct irq_domain	*domain;
> +	void __iomem		*intr;
> +	void __iomem		*cnfg;
> +	struct spmi_controller	*spmic;
> +	u16			base_apid;
> +	int			apid_count;
> +	u32			*mapping_table;
> +	DECLARE_BITMAP(mapping_table_valid, PMIC_ARB_MAX_PERIPHS);
> +	u16			*ppid_to_apid;
> +	u16			last_apid;
> +	struct apid_data	*apid_data;
> +	u16			min_apid;
> +	u16			max_apid;
> +	int			irq;
> +};
...
>  struct spmi_pmic_arb {
>  	void __iomem		*rd_base;
>  	void __iomem		*wr_base;
> -	void __iomem		*intr;
> -	void __iomem		*cnfg;
>  	void __iomem		*core;
>  	resource_size_t		core_size;
>  	raw_spinlock_t		lock;

Can you please move "lock" from "struct spmi_pmic_arb" into "struct
spmi_pmic_arb_bus" and update its usage in the functions below?  The two
SPMI buses within PMIC Arbiter v7 operate entirely independently and
write to separate sets of registers.  As-is, transactions on one bus
would unnecessarily block transactions on the other, leading to a
performance penalty.

>  	u8			channel;
> -	int			irq;
>  	u8			ee;
> -	u32			bus_instance;
> -	u16			min_apid;
> -	u16			max_apid;
> -	u16			base_apid;
> -	int			apid_count;
> -	u32			*mapping_table;
> -	DECLARE_BITMAP(mapping_table_valid, PMIC_ARB_MAX_PERIPHS);
> -	struct irq_domain	*domain;
> -	struct spmi_controller	*spmic;
>  	const struct pmic_arb_ver_ops *ver_ops;
> -	u16			*ppid_to_apid;
> -	u16			last_apid;
> -	struct apid_data	*apid_data;
>  	int			max_periphs;
> +	struct spmi_pmic_arb_bus *bus;
>  };

Thanks,
David Collins




More information about the Linux-mediatek mailing list