> On 10-Aug-2023, at 3:28 AM, Reza Arbab <ar...@linux.ibm.com> wrote:
> 
> On Mon, Jul 17, 2023 at 08:54:31AM +0530, Athira Rajeev wrote:
>> @@ -408,14 +469,129 @@ static void disable_unavailable_units(struct dt_node 
>> *dev)
>> avl_vec = (0xffULL) << 56;
>> }
>> 
>> - for (i = 0; i < ARRAY_SIZE(nest_pmus); i++) {
>> - if (!(PPC_BITMASK(i, i) & avl_vec)) {
>> - /* Check if the device node exists */
>> - target = dt_find_by_name_before_addr(dev, nest_pmus[i]);
>> - if (!target)
>> - continue;
>> - /* Remove the device node */
>> - dt_free(target);
>> + if (proc_gen == proc_gen_p9) {
>> + for (i = 0; i < ARRAY_SIZE(nest_pmus_p9); i++) {
>> + if (!(PPC_BITMASK(i, i) & avl_vec)) {
> 
> I think all these PPC_BITMASK(i, i) can be changed to PPC_BIT(i).

Hi Reza,

Thanks for reviewing the changes.
Yes. I will add the change in next version

Thanks
Athira
> 
>> + /* Check if the device node exists */
>> + target = dt_find_by_name_before_addr(dev, nest_pmus_p9[i]);
>> + if (!target)
>> + continue;
>> + /* Remove the device node */
>> + dt_free(target);
>> + }
>> + }
>> + } else if (proc_gen == proc_gen_p10) {
>> + int val;
>> + char name[8];
>> +
>> + for (i = 0; i < 11; i++) {
>> + if (!(PPC_BITMASK(i, i) & avl_vec)) {
>> + /* Check if the device node exists */
>> + target = dt_find_by_name_before_addr(dev, nest_pmus_p10[i]);
>> + if (!target)
>> + continue;
>> + /* Remove the device node */
>> + dt_free(target);
>> + }
>> + }
>> +
>> + for (i = 35; i < 41; i++) {
>> + if (!(PPC_BITMASK(i, i) & avl_vec)) {
>> + /* Check if the device node exists for phb */
>> + for (j = 0; j < 3; j++) {
>> + snprintf(name, sizeof(name), "phb%d_%d", (i-35), j);
>> + target = dt_find_by_name_before_addr(dev, name);
>> + if (!target)
>> + continue;
>> + /* Remove the device node */
>> + dt_free(target);
>> + }
>> + }
>> + }
>> +
>> + for (i = 41; i < 58; i++) {
>> + if (!(PPC_BITMASK(i, i) & avl_vec)) {
>> + /* Check if the device node exists */
>> + target = dt_find_by_name_before_addr(dev, nest_pmus_p10[i]);
>> + if (!target)
>> + continue;
>> + /* Remove the device node */
>> + dt_free(target);
>> + }
>> + }
> 
> -- 
> Reza Arbab

Reply via email to