Lines Matching refs:buf_hw
840 static void get_etr_buf_hw(struct device *dev, struct etr_buf_hw *buf_hw) in get_etr_buf_hw() argument
844 buf_hw->has_iommu = iommu_get_domain_for_dev(dev->parent); in get_etr_buf_hw()
845 buf_hw->has_etr_sg = tmc_etr_has_cap(drvdata, TMC_ETR_SG); in get_etr_buf_hw()
846 buf_hw->has_catu = !!tmc_etr_get_catu_device(drvdata); in get_etr_buf_hw()
849 static bool etr_can_use_flat_mode(struct etr_buf_hw *buf_hw, ssize_t etr_buf_size) in etr_can_use_flat_mode() argument
851 bool has_sg = buf_hw->has_catu || buf_hw->has_etr_sg; in etr_can_use_flat_mode()
853 return !has_sg || buf_hw->has_iommu || etr_buf_size < SZ_1M; in etr_can_use_flat_mode()
870 struct etr_buf_hw buf_hw; in tmc_alloc_etr_buf() local
873 get_etr_buf_hw(dev, &buf_hw); in tmc_alloc_etr_buf()
897 if (rc && !pages && etr_can_use_flat_mode(&buf_hw, size)) in tmc_alloc_etr_buf()
900 if (rc && buf_hw.has_etr_sg) in tmc_alloc_etr_buf()
903 if (rc && buf_hw.has_catu) in tmc_alloc_etr_buf()
1840 struct etr_buf_hw buf_hw; in buf_modes_available_show() local
1843 get_etr_buf_hw(dev, &buf_hw); in buf_modes_available_show()
1846 if (buf_hw.has_etr_sg) in buf_modes_available_show()
1849 if (buf_hw.has_catu) in buf_modes_available_show()
1870 struct etr_buf_hw buf_hw; in buf_mode_preferred_store() local
1872 get_etr_buf_hw(dev, &buf_hw); in buf_mode_preferred_store()
1875 else if (sysfs_streq(buf, buf_modes_str[ETR_MODE_ETR_SG]) && buf_hw.has_etr_sg) in buf_mode_preferred_store()
1877 else if (sysfs_streq(buf, buf_modes_str[ETR_MODE_CATU]) && buf_hw.has_catu) in buf_mode_preferred_store()