~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/pstore/ram.c

Version: ~ [ linux-5.5-rc7 ] ~ [ linux-5.4.13 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.97 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.166 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.210 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.210 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.81 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * RAM Oops/Panic logger
  3  *
  4  * Copyright (C) 2010 Marco Stornelli <marco.stornelli@gmail.com>
  5  * Copyright (C) 2011 Kees Cook <keescook@chromium.org>
  6  *
  7  * This program is free software; you can redistribute it and/or
  8  * modify it under the terms of the GNU General Public License
  9  * version 2 as published by the Free Software Foundation.
 10  *
 11  * This program is distributed in the hope that it will be useful, but
 12  * WITHOUT ANY WARRANTY; without even the implied warranty of
 13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14  * General Public License for more details.
 15  *
 16  * You should have received a copy of the GNU General Public License
 17  * along with this program; if not, write to the Free Software
 18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 19  * 02110-1301 USA
 20  *
 21  */
 22 
 23 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 24 
 25 #include <linux/kernel.h>
 26 #include <linux/err.h>
 27 #include <linux/module.h>
 28 #include <linux/version.h>
 29 #include <linux/pstore.h>
 30 #include <linux/time.h>
 31 #include <linux/io.h>
 32 #include <linux/ioport.h>
 33 #include <linux/platform_device.h>
 34 #include <linux/slab.h>
 35 #include <linux/compiler.h>
 36 #include <linux/pstore_ram.h>
 37 
 38 #define RAMOOPS_KERNMSG_HDR "===="
 39 #define MIN_MEM_SIZE 4096UL
 40 
 41 static ulong record_size = MIN_MEM_SIZE;
 42 module_param(record_size, ulong, 0400);
 43 MODULE_PARM_DESC(record_size,
 44                 "size of each dump done on oops/panic");
 45 
 46 static ulong ramoops_console_size = MIN_MEM_SIZE;
 47 module_param_named(console_size, ramoops_console_size, ulong, 0400);
 48 MODULE_PARM_DESC(console_size, "size of kernel console log");
 49 
 50 static ulong ramoops_ftrace_size = MIN_MEM_SIZE;
 51 module_param_named(ftrace_size, ramoops_ftrace_size, ulong, 0400);
 52 MODULE_PARM_DESC(ftrace_size, "size of ftrace log");
 53 
 54 static ulong mem_address;
 55 module_param(mem_address, ulong, 0400);
 56 MODULE_PARM_DESC(mem_address,
 57                 "start of reserved RAM used to store oops/panic logs");
 58 
 59 static ulong mem_size;
 60 module_param(mem_size, ulong, 0400);
 61 MODULE_PARM_DESC(mem_size,
 62                 "size of reserved RAM used to store oops/panic logs");
 63 
 64 static unsigned int mem_type;
 65 module_param(mem_type, uint, 0600);
 66 MODULE_PARM_DESC(mem_type,
 67                 "set to 1 to try to use unbuffered memory (default 0)");
 68 
 69 static int dump_oops = 1;
 70 module_param(dump_oops, int, 0600);
 71 MODULE_PARM_DESC(dump_oops,
 72                 "set to 1 to dump oopses, 0 to only dump panics (default 1)");
 73 
 74 static int ramoops_ecc;
 75 module_param_named(ecc, ramoops_ecc, int, 0600);
 76 MODULE_PARM_DESC(ramoops_ecc,
 77                 "if non-zero, the option enables ECC support and specifies "
 78                 "ECC buffer size in bytes (1 is a special value, means 16 "
 79                 "bytes ECC)");
 80 
 81 struct ramoops_context {
 82         struct persistent_ram_zone **przs;
 83         struct persistent_ram_zone *cprz;
 84         struct persistent_ram_zone *fprz;
 85         phys_addr_t phys_addr;
 86         unsigned long size;
 87         unsigned int memtype;
 88         size_t record_size;
 89         size_t console_size;
 90         size_t ftrace_size;
 91         int dump_oops;
 92         struct persistent_ram_ecc_info ecc_info;
 93         unsigned int max_dump_cnt;
 94         unsigned int dump_write_cnt;
 95         /* _read_cnt need clear on ramoops_pstore_open */
 96         unsigned int dump_read_cnt;
 97         unsigned int console_read_cnt;
 98         unsigned int ftrace_read_cnt;
 99         struct pstore_info pstore;
100 };
101 
102 static struct platform_device *dummy;
103 static struct ramoops_platform_data *dummy_data;
104 
105 static int ramoops_pstore_open(struct pstore_info *psi)
106 {
107         struct ramoops_context *cxt = psi->data;
108 
109         cxt->dump_read_cnt = 0;
110         cxt->console_read_cnt = 0;
111         cxt->ftrace_read_cnt = 0;
112         return 0;
113 }
114 
115 static struct persistent_ram_zone *
116 ramoops_get_next_prz(struct persistent_ram_zone *przs[], uint *c, uint max,
117                      u64 *id,
118                      enum pstore_type_id *typep, enum pstore_type_id type,
119                      bool update)
120 {
121         struct persistent_ram_zone *prz;
122         int i = (*c)++;
123 
124         if (i >= max)
125                 return NULL;
126 
127         prz = przs[i];
128         if (!prz)
129                 return NULL;
130 
131         /* Update old/shadowed buffer. */
132         if (update)
133                 persistent_ram_save_old(prz);
134 
135         if (!persistent_ram_old_size(prz))
136                 return NULL;
137 
138         *typep = type;
139         *id = i;
140 
141         return prz;
142 }
143 
144 static void ramoops_read_kmsg_hdr(char *buffer, struct timespec *time,
145                                   bool *compressed)
146 {
147         char data_type;
148 
149         if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lu.%lu-%c\n",
150                         &time->tv_sec, &time->tv_nsec, &data_type) == 3) {
151                 if (data_type == 'C')
152                         *compressed = true;
153                 else
154                         *compressed = false;
155         } else if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lu.%lu\n",
156                         &time->tv_sec, &time->tv_nsec) == 2) {
157                         *compressed = false;
158         } else {
159                 time->tv_sec = 0;
160                 time->tv_nsec = 0;
161                 *compressed = false;
162         }
163 }
164 
165 static ssize_t ramoops_pstore_read(u64 *id, enum pstore_type_id *type,
166                                    int *count, struct timespec *time,
167                                    char **buf, bool *compressed,
168                                    struct pstore_info *psi)
169 {
170         ssize_t size;
171         ssize_t ecc_notice_size;
172         struct ramoops_context *cxt = psi->data;
173         struct persistent_ram_zone *prz;
174 
175         prz = ramoops_get_next_prz(cxt->przs, &cxt->dump_read_cnt,
176                                    cxt->max_dump_cnt, id, type,
177                                    PSTORE_TYPE_DMESG, 1);
178         if (!prz)
179                 prz = ramoops_get_next_prz(&cxt->cprz, &cxt->console_read_cnt,
180                                            1, id, type, PSTORE_TYPE_CONSOLE, 0);
181         if (!prz)
182                 prz = ramoops_get_next_prz(&cxt->fprz, &cxt->ftrace_read_cnt,
183                                            1, id, type, PSTORE_TYPE_FTRACE, 0);
184         if (!prz)
185                 return 0;
186 
187         size = persistent_ram_old_size(prz);
188 
189         /* ECC correction notice */
190         ecc_notice_size = persistent_ram_ecc_string(prz, NULL, 0);
191 
192         *buf = kmalloc(size + ecc_notice_size + 1, GFP_KERNEL);
193         if (*buf == NULL)
194                 return -ENOMEM;
195 
196         memcpy(*buf, persistent_ram_old(prz), size);
197         ramoops_read_kmsg_hdr(*buf, time, compressed);
198         persistent_ram_ecc_string(prz, *buf + size, ecc_notice_size + 1);
199 
200         return size + ecc_notice_size;
201 }
202 
203 static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz,
204                                      bool compressed)
205 {
206         char *hdr;
207         struct timespec timestamp;
208         size_t len;
209 
210         /* Report zeroed timestamp if called before timekeeping has resumed. */
211         if (__getnstimeofday(&timestamp)) {
212                 timestamp.tv_sec = 0;
213                 timestamp.tv_nsec = 0;
214         }
215         hdr = kasprintf(GFP_ATOMIC, RAMOOPS_KERNMSG_HDR "%lu.%lu-%c\n",
216                 (long)timestamp.tv_sec, (long)(timestamp.tv_nsec / 1000),
217                 compressed ? 'C' : 'D');
218         WARN_ON_ONCE(!hdr);
219         len = hdr ? strlen(hdr) : 0;
220         persistent_ram_write(prz, hdr, len);
221         kfree(hdr);
222 
223         return len;
224 }
225 
226 static int notrace ramoops_pstore_write_buf(enum pstore_type_id type,
227                                             enum kmsg_dump_reason reason,
228                                             u64 *id, unsigned int part,
229                                             const char *buf,
230                                             bool compressed, size_t size,
231                                             struct pstore_info *psi)
232 {
233         struct ramoops_context *cxt = psi->data;
234         struct persistent_ram_zone *prz;
235         size_t hlen;
236 
237         if (type == PSTORE_TYPE_CONSOLE) {
238                 if (!cxt->cprz)
239                         return -ENOMEM;
240                 persistent_ram_write(cxt->cprz, buf, size);
241                 return 0;
242         } else if (type == PSTORE_TYPE_FTRACE) {
243                 if (!cxt->fprz)
244                         return -ENOMEM;
245                 persistent_ram_write(cxt->fprz, buf, size);
246                 return 0;
247         }
248 
249         if (type != PSTORE_TYPE_DMESG)
250                 return -EINVAL;
251 
252         /* Out of the various dmesg dump types, ramoops is currently designed
253          * to only store crash logs, rather than storing general kernel logs.
254          */
255         if (reason != KMSG_DUMP_OOPS &&
256             reason != KMSG_DUMP_PANIC)
257                 return -EINVAL;
258 
259         /* Skip Oopes when configured to do so. */
260         if (reason == KMSG_DUMP_OOPS && !cxt->dump_oops)
261                 return -EINVAL;
262 
263         /* Explicitly only take the first part of any new crash.
264          * If our buffer is larger than kmsg_bytes, this can never happen,
265          * and if our buffer is smaller than kmsg_bytes, we don't want the
266          * report split across multiple records.
267          */
268         if (part != 1)
269                 return -ENOSPC;
270 
271         if (!cxt->przs)
272                 return -ENOSPC;
273 
274         prz = cxt->przs[cxt->dump_write_cnt];
275 
276         hlen = ramoops_write_kmsg_hdr(prz, compressed);
277         if (size + hlen > prz->buffer_size)
278                 size = prz->buffer_size - hlen;
279         persistent_ram_write(prz, buf, size);
280 
281         cxt->dump_write_cnt = (cxt->dump_write_cnt + 1) % cxt->max_dump_cnt;
282 
283         return 0;
284 }
285 
286 static int ramoops_pstore_erase(enum pstore_type_id type, u64 id, int count,
287                                 struct timespec time, struct pstore_info *psi)
288 {
289         struct ramoops_context *cxt = psi->data;
290         struct persistent_ram_zone *prz;
291 
292         switch (type) {
293         case PSTORE_TYPE_DMESG:
294                 if (id >= cxt->max_dump_cnt)
295                         return -EINVAL;
296                 prz = cxt->przs[id];
297                 break;
298         case PSTORE_TYPE_CONSOLE:
299                 prz = cxt->cprz;
300                 break;
301         case PSTORE_TYPE_FTRACE:
302                 prz = cxt->fprz;
303                 break;
304         default:
305                 return -EINVAL;
306         }
307 
308         persistent_ram_free_old(prz);
309         persistent_ram_zap(prz);
310 
311         return 0;
312 }
313 
314 static struct ramoops_context oops_cxt = {
315         .pstore = {
316                 .owner  = THIS_MODULE,
317                 .name   = "ramoops",
318                 .open   = ramoops_pstore_open,
319                 .read   = ramoops_pstore_read,
320                 .write_buf      = ramoops_pstore_write_buf,
321                 .erase  = ramoops_pstore_erase,
322         },
323 };
324 
325 static void ramoops_free_przs(struct ramoops_context *cxt)
326 {
327         int i;
328 
329         if (!cxt->przs)
330                 return;
331 
332         for (i = 0; !IS_ERR_OR_NULL(cxt->przs[i]); i++)
333                 persistent_ram_free(cxt->przs[i]);
334         kfree(cxt->przs);
335 }
336 
337 static int ramoops_init_przs(struct device *dev, struct ramoops_context *cxt,
338                              phys_addr_t *paddr, size_t dump_mem_sz)
339 {
340         int err = -ENOMEM;
341         int i;
342 
343         if (!cxt->record_size)
344                 return 0;
345 
346         if (*paddr + dump_mem_sz - cxt->phys_addr > cxt->size) {
347                 dev_err(dev, "no room for dumps\n");
348                 return -ENOMEM;
349         }
350 
351         cxt->max_dump_cnt = dump_mem_sz / cxt->record_size;
352         if (!cxt->max_dump_cnt)
353                 return -ENOMEM;
354 
355         cxt->przs = kzalloc(sizeof(*cxt->przs) * cxt->max_dump_cnt,
356                              GFP_KERNEL);
357         if (!cxt->przs) {
358                 dev_err(dev, "failed to initialize a prz array for dumps\n");
359                 return -ENOMEM;
360         }
361 
362         for (i = 0; i < cxt->max_dump_cnt; i++) {
363                 size_t sz = cxt->record_size;
364 
365                 cxt->przs[i] = persistent_ram_new(*paddr, sz, 0,
366                                                   &cxt->ecc_info,
367                                                   cxt->memtype);
368                 if (IS_ERR(cxt->przs[i])) {
369                         err = PTR_ERR(cxt->przs[i]);
370                         dev_err(dev, "failed to request mem region (0x%zx@0x%llx): %d\n",
371                                 sz, (unsigned long long)*paddr, err);
372                         goto fail_prz;
373                 }
374                 *paddr += sz;
375         }
376 
377         return 0;
378 fail_prz:
379         ramoops_free_przs(cxt);
380         return err;
381 }
382 
383 static int ramoops_init_prz(struct device *dev, struct ramoops_context *cxt,
384                             struct persistent_ram_zone **prz,
385                             phys_addr_t *paddr, size_t sz, u32 sig)
386 {
387         if (!sz)
388                 return 0;
389 
390         if (*paddr + sz - cxt->phys_addr > cxt->size) {
391                 dev_err(dev, "no room for mem region (0x%zx@0x%llx) in (0x%lx@0x%llx)\n",
392                         sz, (unsigned long long)*paddr,
393                         cxt->size, (unsigned long long)cxt->phys_addr);
394                 return -ENOMEM;
395         }
396 
397         *prz = persistent_ram_new(*paddr, sz, sig, &cxt->ecc_info, cxt->memtype);
398         if (IS_ERR(*prz)) {
399                 int err = PTR_ERR(*prz);
400 
401                 dev_err(dev, "failed to request mem region (0x%zx@0x%llx): %d\n",
402                         sz, (unsigned long long)*paddr, err);
403                 return err;
404         }
405 
406         persistent_ram_zap(*prz);
407 
408         *paddr += sz;
409 
410         return 0;
411 }
412 
413 static int ramoops_probe(struct platform_device *pdev)
414 {
415         struct device *dev = &pdev->dev;
416         struct ramoops_platform_data *pdata = pdev->dev.platform_data;
417         struct ramoops_context *cxt = &oops_cxt;
418         size_t dump_mem_sz;
419         phys_addr_t paddr;
420         int err = -EINVAL;
421 
422         /* Only a single ramoops area allowed at a time, so fail extra
423          * probes.
424          */
425         if (cxt->max_dump_cnt)
426                 goto fail_out;
427 
428         if (!pdata->mem_size || (!pdata->record_size && !pdata->console_size &&
429                         !pdata->ftrace_size)) {
430                 pr_err("The memory size and the record/console size must be "
431                         "non-zero\n");
432                 goto fail_out;
433         }
434 
435         if (pdata->record_size && !is_power_of_2(pdata->record_size))
436                 pdata->record_size = rounddown_pow_of_two(pdata->record_size);
437         if (pdata->console_size && !is_power_of_2(pdata->console_size))
438                 pdata->console_size = rounddown_pow_of_two(pdata->console_size);
439         if (pdata->ftrace_size && !is_power_of_2(pdata->ftrace_size))
440                 pdata->ftrace_size = rounddown_pow_of_two(pdata->ftrace_size);
441 
442         cxt->size = pdata->mem_size;
443         cxt->phys_addr = pdata->mem_address;
444         cxt->memtype = pdata->mem_type;
445         cxt->record_size = pdata->record_size;
446         cxt->console_size = pdata->console_size;
447         cxt->ftrace_size = pdata->ftrace_size;
448         cxt->dump_oops = pdata->dump_oops;
449         cxt->ecc_info = pdata->ecc_info;
450 
451         paddr = cxt->phys_addr;
452 
453         dump_mem_sz = cxt->size - cxt->console_size - cxt->ftrace_size;
454         err = ramoops_init_przs(dev, cxt, &paddr, dump_mem_sz);
455         if (err)
456                 goto fail_out;
457 
458         err = ramoops_init_prz(dev, cxt, &cxt->cprz, &paddr,
459                                cxt->console_size, 0);
460         if (err)
461                 goto fail_init_cprz;
462 
463         err = ramoops_init_prz(dev, cxt, &cxt->fprz, &paddr, cxt->ftrace_size,
464                                LINUX_VERSION_CODE);
465         if (err)
466                 goto fail_init_fprz;
467 
468         if (!cxt->przs && !cxt->cprz && !cxt->fprz) {
469                 pr_err("memory size too small, minimum is %zu\n",
470                         cxt->console_size + cxt->record_size +
471                         cxt->ftrace_size);
472                 err = -EINVAL;
473                 goto fail_cnt;
474         }
475 
476         cxt->pstore.data = cxt;
477         /*
478          * Console can handle any buffer size, so prefer LOG_LINE_MAX. If we
479          * have to handle dumps, we must have at least record_size buffer. And
480          * for ftrace, bufsize is irrelevant (if bufsize is 0, buf will be
481          * ZERO_SIZE_PTR).
482          */
483         if (cxt->console_size)
484                 cxt->pstore.bufsize = 1024; /* LOG_LINE_MAX */
485         cxt->pstore.bufsize = max(cxt->record_size, cxt->pstore.bufsize);
486         cxt->pstore.buf = kmalloc(cxt->pstore.bufsize, GFP_KERNEL);
487         spin_lock_init(&cxt->pstore.buf_lock);
488         if (!cxt->pstore.buf) {
489                 pr_err("cannot allocate pstore buffer\n");
490                 err = -ENOMEM;
491                 goto fail_clear;
492         }
493 
494         err = pstore_register(&cxt->pstore);
495         if (err) {
496                 pr_err("registering with pstore failed\n");
497                 goto fail_buf;
498         }
499 
500         /*
501          * Update the module parameter variables as well so they are visible
502          * through /sys/module/ramoops/parameters/
503          */
504         mem_size = pdata->mem_size;
505         mem_address = pdata->mem_address;
506         record_size = pdata->record_size;
507         dump_oops = pdata->dump_oops;
508 
509         pr_info("attached 0x%lx@0x%llx, ecc: %d/%d\n",
510                 cxt->size, (unsigned long long)cxt->phys_addr,
511                 cxt->ecc_info.ecc_size, cxt->ecc_info.block_size);
512 
513         return 0;
514 
515 fail_buf:
516         kfree(cxt->pstore.buf);
517 fail_clear:
518         cxt->pstore.bufsize = 0;
519         cxt->max_dump_cnt = 0;
520 fail_cnt:
521         kfree(cxt->fprz);
522 fail_init_fprz:
523         kfree(cxt->cprz);
524 fail_init_cprz:
525         ramoops_free_przs(cxt);
526 fail_out:
527         return err;
528 }
529 
530 static int __exit ramoops_remove(struct platform_device *pdev)
531 {
532 #if 0
533         /* TODO(kees): We cannot unload ramoops since pstore doesn't support
534          * unregistering yet.
535          */
536         struct ramoops_context *cxt = &oops_cxt;
537 
538         iounmap(cxt->virt_addr);
539         release_mem_region(cxt->phys_addr, cxt->size);
540         cxt->max_dump_cnt = 0;
541 
542         /* TODO(kees): When pstore supports unregistering, call it here. */
543         kfree(cxt->pstore.buf);
544         cxt->pstore.bufsize = 0;
545 
546         return 0;
547 #endif
548         return -EBUSY;
549 }
550 
551 static struct platform_driver ramoops_driver = {
552         .probe          = ramoops_probe,
553         .remove         = __exit_p(ramoops_remove),
554         .driver         = {
555                 .name   = "ramoops",
556                 .owner  = THIS_MODULE,
557         },
558 };
559 
560 static void ramoops_register_dummy(void)
561 {
562         if (!mem_size)
563                 return;
564 
565         pr_info("using module parameters\n");
566 
567         dummy_data = kzalloc(sizeof(*dummy_data), GFP_KERNEL);
568         if (!dummy_data) {
569                 pr_info("could not allocate pdata\n");
570                 return;
571         }
572 
573         dummy_data->mem_size = mem_size;
574         dummy_data->mem_address = mem_address;
575         dummy_data->mem_type = 0;
576         dummy_data->record_size = record_size;
577         dummy_data->console_size = ramoops_console_size;
578         dummy_data->ftrace_size = ramoops_ftrace_size;
579         dummy_data->dump_oops = dump_oops;
580         /*
581          * For backwards compatibility ramoops.ecc=1 means 16 bytes ECC
582          * (using 1 byte for ECC isn't much of use anyway).
583          */
584         dummy_data->ecc_info.ecc_size = ramoops_ecc == 1 ? 16 : ramoops_ecc;
585 
586         dummy = platform_device_register_data(NULL, "ramoops", -1,
587                         dummy_data, sizeof(struct ramoops_platform_data));
588         if (IS_ERR(dummy)) {
589                 pr_info("could not create platform device: %ld\n",
590                         PTR_ERR(dummy));
591         }
592 }
593 
594 static int __init ramoops_init(void)
595 {
596         ramoops_register_dummy();
597         return platform_driver_register(&ramoops_driver);
598 }
599 postcore_initcall(ramoops_init);
600 
601 static void __exit ramoops_exit(void)
602 {
603         platform_driver_unregister(&ramoops_driver);
604         platform_device_unregister(dummy);
605         kfree(dummy_data);
606 }
607 module_exit(ramoops_exit);
608 
609 MODULE_LICENSE("GPL");
610 MODULE_AUTHOR("Marco Stornelli <marco.stornelli@gmail.com>");
611 MODULE_DESCRIPTION("RAM Oops/Panic logger/driver");
612 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp