History

acpi/nfit: Issue Start ARS to retrieve existing records

ACPI 6.2 defines in section 9.20.7.2 that the OSPM may call a Start ARS with Flags Bit [1] set upon receiving the 0x81 notification. Upon receiving the notification, the OSPM may decide to issue a Start ARS with Flags Bit [1] set to prepare for the retrieval of existing records and issue the Query ARS Status function to retrieve the records. Add support to call a Start ARS from acpi_nfit_uc_error_notify() with ND_ARS_RETURN_PREV_DATA set when HW_ERROR_SCRUB_ON is not set.

Toshi Kani committed 9 years ago

Commit 80790031 parent 759d6a94 files · +14 −5Browse files

Unified · Split

4 files
  1. drivers/acpi/nfit/core.c +10 −3
  2. drivers/acpi/nfit/mce.c +1 −1
  3. drivers/acpi/nfit/nfit.h +2 −1
  4. include/uapi/linux/ndctl.h +1 −0
drivers/acpi/nfit/core.c+10−3
@@ -1044,7 +1044,7 @@ static ssize_t scrub_store(struct device *dev, · 1043 unmodified lines
1044 if (nd_desc) {1044 if (nd_desc) {
1045 struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);1045 struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
1046 1046
1047 rc = acpi_nfit_ars_rescan(acpi_desc);1047 rc = acpi_nfit_ars_rescan(acpi_desc, 0);
1048 }1048 }
1049 device_unlock(dev);1049 device_unlock(dev);
1050 if (rc)1050 if (rc)
@@ -2137,6 +2137,7 @@ static int ars_start(struct acpi_nfit_desc *acpi_desc, struct nfit_spa *nfit_spa · 1086 unmodified lines
2137 memset(&ars_start, 0, sizeof(ars_start));2137 memset(&ars_start, 0, sizeof(ars_start));
2138 ars_start.address = spa->address;2138 ars_start.address = spa->address;
2139 ars_start.length = spa->length;2139 ars_start.length = spa->length;
2140 ars_start.flags = acpi_desc->ars_start_flags;
2140 if (nfit_spa_type(spa) == NFIT_SPA_PM)2141 if (nfit_spa_type(spa) == NFIT_SPA_PM)
2141 ars_start.type = ND_ARS_PERSISTENT;2142 ars_start.type = ND_ARS_PERSISTENT;
2142 else if (nfit_spa_type(spa) == NFIT_SPA_VOLATILE)2143 else if (nfit_spa_type(spa) == NFIT_SPA_VOLATILE)
@@ -2163,6 +2164,7 @@ static int ars_continue(struct acpi_nfit_desc *acpi_desc) · 20 unmodified lines
2163 ars_start.address = ars_status->restart_address;2164 ars_start.address = ars_status->restart_address;
2164 ars_start.length = ars_status->restart_length;2165 ars_start.length = ars_status->restart_length;
2165 ars_start.type = ars_status->type;2166 ars_start.type = ars_status->type;
2167 ars_start.flags = acpi_desc->ars_start_flags;
2166 rc = nd_desc->ndctl(nd_desc, NULL, ND_CMD_ARS_START, &ars_start,2168 rc = nd_desc->ndctl(nd_desc, NULL, ND_CMD_ARS_START, &ars_start,
2167 sizeof(ars_start), &cmd_rc);2169 sizeof(ars_start), &cmd_rc);
2168 if (rc < 0)2170 if (rc < 0)
@@ -2684,6 +2686,7 @@ static void acpi_nfit_scrub(struct work_struct *work) · 515 unmodified lines
2684 list_for_each_entry(nfit_spa, &acpi_desc->spas, list)2686 list_for_each_entry(nfit_spa, &acpi_desc->spas, list)
2685 acpi_nfit_async_scrub(acpi_desc, nfit_spa);2687 acpi_nfit_async_scrub(acpi_desc, nfit_spa);
2686 acpi_desc->scrub_count++;2688 acpi_desc->scrub_count++;
2689 acpi_desc->ars_start_flags = 0;
2687 if (acpi_desc->scrub_count_state)2690 if (acpi_desc->scrub_count_state)
2688 sysfs_notify_dirent(acpi_desc->scrub_count_state);2691 sysfs_notify_dirent(acpi_desc->scrub_count_state);
2689 mutex_unlock(&acpi_desc->init_mutex);2692 mutex_unlock(&acpi_desc->init_mutex);
@@ -2702,6 +2705,7 @@ static int acpi_nfit_register_regions(struct acpi_nfit_desc *acpi_desc) · 12 unmodified lines
2702 return rc;2705 return rc;
2703 }2706 }
2704 2707
2708 acpi_desc->ars_start_flags = 0;
2705 if (!acpi_desc->cancel)2709 if (!acpi_desc->cancel)
2706 queue_work(nfit_wq, &acpi_desc->work);2710 queue_work(nfit_wq, &acpi_desc->work);
2707 return 0;2711 return 0;
@@ -2906,7 +2910,7 @@ static int acpi_nfit_clear_to_send(struct nvdimm_bus_descriptor *nd_desc, · 198 unmodified lines
2906 return 0;2910 return 0;
2907}2911}
2908 2912
2909int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc)2913int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc, u8 flags)
2910{2914{
2911 struct device *dev = acpi_desc->dev;2915 struct device *dev = acpi_desc->dev;
2912 struct nfit_spa *nfit_spa;2916 struct nfit_spa *nfit_spa;
@@ -2928,6 +2932,7 @@ int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc) · 15 unmodified lines
2928 2932
2929 nfit_spa->ars_required = 1;2933 nfit_spa->ars_required = 1;
2930 }2934 }
2935 acpi_desc->ars_start_flags = flags;
2931 queue_work(nfit_wq, &acpi_desc->work);2936 queue_work(nfit_wq, &acpi_desc->work);
2932 dev_dbg(dev, "%s: ars_scan triggered\n", __func__);2937 dev_dbg(dev, "%s: ars_scan triggered\n", __func__);
2933 mutex_unlock(&acpi_desc->init_mutex);2938 mutex_unlock(&acpi_desc->init_mutex);
@@ -3104,8 +3109,10 @@ static void acpi_nfit_update_notify(struct device *dev, acpi_handle handle) · 170 unmodified lines
3104static void acpi_nfit_uc_error_notify(struct device *dev, acpi_handle handle)3109static void acpi_nfit_uc_error_notify(struct device *dev, acpi_handle handle)
3105{3110{
3106 struct acpi_nfit_desc *acpi_desc = dev_get_drvdata(dev);3111 struct acpi_nfit_desc *acpi_desc = dev_get_drvdata(dev);
3112 u8 flags = (acpi_desc->scrub_mode == HW_ERROR_SCRUB_ON) ?
3113 0 : ND_ARS_RETURN_PREV_DATA;
3107 3114
3108 acpi_nfit_ars_rescan(acpi_desc);3115 acpi_nfit_ars_rescan(acpi_desc, flags);
3109}3116}
3110 3117
3111void __acpi_nfit_notify(struct device *dev, acpi_handle handle, u32 event)3118void __acpi_nfit_notify(struct device *dev, acpi_handle handle, u32 event)
drivers/acpi/nfit/mce.c+1−1
@@ -79,7 +79,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val, · 78 unmodified lines
79 * already in progress, just let that be the last79 * already in progress, just let that be the last
80 * authoritative one80 * authoritative one
81 */81 */
82 acpi_nfit_ars_rescan(acpi_desc);82 acpi_nfit_ars_rescan(acpi_desc, 0);
83 }83 }
84 break;84 break;
85 }85 }
drivers/acpi/nfit/nfit.h+2−1
@@ -155,6 +155,7 @@ struct acpi_nfit_desc { · 154 unmodified lines
155 struct list_head idts;155 struct list_head idts;
156 struct nvdimm_bus *nvdimm_bus;156 struct nvdimm_bus *nvdimm_bus;
157 struct device *dev;157 struct device *dev;
158 u8 ars_start_flags;
158 struct nd_cmd_ars_status *ars_status;159 struct nd_cmd_ars_status *ars_status;
159 size_t ars_status_size;160 size_t ars_status_size;
160 struct work_struct work;161 struct work_struct work;
@@ -207,7 +208,7 @@ struct nfit_blk { · 46 unmodified lines
207 208
208extern struct list_head acpi_descs;209extern struct list_head acpi_descs;
209extern struct mutex acpi_desc_lock;210extern struct mutex acpi_desc_lock;
210int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc);211int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc, u8 flags);
211 212
212#ifdef CONFIG_X86_MCE213#ifdef CONFIG_X86_MCE
213void nfit_mce_register(void);214void nfit_mce_register(void);
include/uapi/linux/ndctl.h+1−0
@@ -207,6 +207,7 @@ enum { · 206 unmodified lines
207enum {207enum {
208 ND_ARS_VOLATILE = 1,208 ND_ARS_VOLATILE = 1,
209 ND_ARS_PERSISTENT = 2,209 ND_ARS_PERSISTENT = 2,
210 ND_ARS_RETURN_PREV_DATA = 1 << 1,
210 ND_CONFIG_LOCKED = 1,211 ND_CONFIG_LOCKED = 1,
211};212};
212 213

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t