···27272828/*2929 * This function is used to get the notification from the drmgr when3030- * QoS credits are changed. Though receiving the target total QoS3131- * credits here, get the official QoS capabilities from the hypervisor.3030+ * QoS credits are changed.3231 */3333-static ssize_t update_total_credits_trigger(struct vas_cop_feat_caps *caps,3232+static ssize_t update_total_credits_store(struct vas_cop_feat_caps *caps,3433 const char *buf, size_t count)3534{3635 int err;3736 u16 creds;38373938 err = kstrtou16(buf, 0, &creds);3939+ /*4040+ * The user space interface from the management console4141+ * notifies OS with the new QoS credits and then the4242+ * hypervisor. So OS has to use this new credits value4343+ * and reconfigure VAS windows (close or reopen depends4444+ * on the credits available) instead of depending on VAS4545+ * QoS capabilities from the hypervisor.4646+ */4047 if (!err)4141- err = vas_reconfig_capabilties(caps->win_type);4848+ err = vas_reconfig_capabilties(caps->win_type, creds);42494350 if (err)4451 return -EINVAL;5252+5353+ pr_info("Set QoS total credits %u\n", creds);45544655 return count;4756}···10192VAS_ATTR_RO(nr_used_credits);1029310394static struct vas_sysfs_entry update_total_credits_attribute =104104- __ATTR(update_total_credits, 0200, NULL, update_total_credits_trigger);9595+ __ATTR(update_total_credits, 0200, NULL, update_total_credits_store);1059610697static struct attribute *vas_def_capab_attrs[] = {10798 &nr_total_credits_attribute.attr,
+12-11
arch/powerpc/platforms/pseries/vas.c
···779779 * changes. Reconfig window configurations based on the credits780780 * availability from this new capabilities.781781 */782782-int vas_reconfig_capabilties(u8 type)782782+int vas_reconfig_capabilties(u8 type, int new_nr_creds)783783{784784 struct vas_cop_feat_caps *caps;785785- int old_nr_creds, new_nr_creds;785785+ int old_nr_creds;786786 struct vas_caps *vcaps;787787 int rc = 0, nr_active_wins;788788···795795 caps = &vcaps->caps;796796797797 mutex_lock(&vas_pseries_mutex);798798- rc = h_query_vas_capabilities(H_QUERY_VAS_CAPABILITIES, vcaps->feat,799799- (u64)virt_to_phys(&hv_cop_caps));800800- if (rc)801801- goto out;802802-803803- new_nr_creds = be16_to_cpu(hv_cop_caps.target_lpar_creds);804798805799 old_nr_creds = atomic_read(&caps->nr_total_credits);806800···826832 false);827833 }828834829829-out:830835 mutex_unlock(&vas_pseries_mutex);831836 return rc;832837}···843850 struct of_reconfig_data *rd = data;844851 struct device_node *dn = rd->dn;845852 const __be32 *intserv = NULL;846846- int len, rc = 0;853853+ int new_nr_creds, len, rc = 0;847854848855 if ((action == OF_RECONFIG_ATTACH_NODE) ||849856 (action == OF_RECONFIG_DETACH_NODE))···855862 if (!intserv)856863 return NOTIFY_OK;857864858858- rc = vas_reconfig_capabilties(VAS_GZIP_DEF_FEAT_TYPE);865865+ rc = h_query_vas_capabilities(H_QUERY_VAS_CAPABILITIES,866866+ vascaps[VAS_GZIP_DEF_FEAT_TYPE].feat,867867+ (u64)virt_to_phys(&hv_cop_caps));868868+ if (!rc) {869869+ new_nr_creds = be16_to_cpu(hv_cop_caps.target_lpar_creds);870870+ rc = vas_reconfig_capabilties(VAS_GZIP_DEF_FEAT_TYPE,871871+ new_nr_creds);872872+ }873873+859874 if (rc)860875 pr_err("Failed reconfig VAS capabilities with DLPAR\n");861876