.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * CXL Flash Device Driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * Matthew R. Ochs <mrochs@linux.vnet.ibm.com>, IBM Corporation |
---|
6 | 7 | * |
---|
7 | 8 | * Copyright (C) 2015 IBM Corporation |
---|
8 | | - * |
---|
9 | | - * This program is free software; you can redistribute it and/or |
---|
10 | | - * modify it under the terms of the GNU General Public License |
---|
11 | | - * as published by the Free Software Foundation; either version |
---|
12 | | - * 2 of the License, or (at your option) any later version. |
---|
13 | 9 | */ |
---|
14 | 10 | |
---|
15 | 11 | #include <linux/delay.h> |
---|
.. | .. |
---|
48 | 44 | struct afu *afu = cmd->parent; |
---|
49 | 45 | struct cxlflash_cfg *cfg = afu->parent; |
---|
50 | 46 | struct device *dev = &cfg->dev->dev; |
---|
51 | | - struct sisl_ioarcb *ioarcb; |
---|
52 | 47 | struct sisl_ioasa *ioasa; |
---|
53 | 48 | u32 resid; |
---|
54 | 49 | |
---|
55 | | - if (unlikely(!cmd)) |
---|
56 | | - return; |
---|
57 | | - |
---|
58 | | - ioarcb = &(cmd->rcb); |
---|
59 | 50 | ioasa = &(cmd->sa); |
---|
60 | 51 | |
---|
61 | 52 | if (ioasa->rc.flags & SISL_RC_FLAGS_UNDERRUN) { |
---|
.. | .. |
---|
757 | 748 | /* SISL_MSI_ASYNC_ERROR is setup only for the primary HWQ */ |
---|
758 | 749 | if (index == PRIMARY_HWQ) |
---|
759 | 750 | cfg->ops->unmap_afu_irq(hwq->ctx_cookie, 3, hwq); |
---|
| 751 | + fallthrough; |
---|
760 | 752 | case UNMAP_TWO: |
---|
761 | 753 | cfg->ops->unmap_afu_irq(hwq->ctx_cookie, 2, hwq); |
---|
| 754 | + fallthrough; |
---|
762 | 755 | case UNMAP_ONE: |
---|
763 | 756 | cfg->ops->unmap_afu_irq(hwq->ctx_cookie, 1, hwq); |
---|
| 757 | + fallthrough; |
---|
764 | 758 | case FREE_IRQ: |
---|
765 | 759 | cfg->ops->free_afu_irqs(hwq->ctx_cookie); |
---|
766 | | - /* fall through */ |
---|
| 760 | + fallthrough; |
---|
767 | 761 | case UNDO_NOOP: |
---|
768 | 762 | /* No action required */ |
---|
769 | 763 | break; |
---|
.. | .. |
---|
977 | 971 | switch (cfg->init_state) { |
---|
978 | 972 | case INIT_STATE_CDEV: |
---|
979 | 973 | cxlflash_release_chrdev(cfg); |
---|
| 974 | + fallthrough; |
---|
980 | 975 | case INIT_STATE_SCSI: |
---|
981 | 976 | cxlflash_term_local_luns(cfg); |
---|
982 | 977 | scsi_remove_host(cfg->host); |
---|
| 978 | + fallthrough; |
---|
983 | 979 | case INIT_STATE_AFU: |
---|
984 | 980 | term_afu(cfg); |
---|
| 981 | + fallthrough; |
---|
985 | 982 | case INIT_STATE_PCI: |
---|
986 | 983 | cfg->ops->destroy_afu(cfg->afu_cookie); |
---|
987 | 984 | pci_disable_device(pdev); |
---|
| 985 | + fallthrough; |
---|
988 | 986 | case INIT_STATE_NONE: |
---|
989 | 987 | free_mem(cfg); |
---|
990 | 988 | scsi_host_put(cfg->host); |
---|
.. | .. |
---|
2357 | 2355 | cxlflash_schedule_async_reset(cfg); |
---|
2358 | 2356 | break; |
---|
2359 | 2357 | } |
---|
2360 | | - /* fall through to retry */ |
---|
| 2358 | + fallthrough; /* to retry */ |
---|
2361 | 2359 | case -EAGAIN: |
---|
2362 | 2360 | if (++nretry < 2) |
---|
2363 | 2361 | goto retry; |
---|
2364 | | - /* fall through to exit */ |
---|
| 2362 | + fallthrough; /* to exit */ |
---|
2365 | 2363 | default: |
---|
2366 | 2364 | break; |
---|
2367 | 2365 | } |
---|
.. | .. |
---|
2535 | 2533 | cfg->state = STATE_NORMAL; |
---|
2536 | 2534 | wake_up_all(&cfg->reset_waitq); |
---|
2537 | 2535 | ssleep(1); |
---|
2538 | | - /* fall through */ |
---|
| 2536 | + fallthrough; |
---|
2539 | 2537 | case STATE_RESET: |
---|
2540 | 2538 | wait_event(cfg->reset_waitq, cfg->state != STATE_RESET); |
---|
2541 | 2539 | if (cfg->state == STATE_NORMAL) |
---|
2542 | 2540 | break; |
---|
2543 | | - /* fall through */ |
---|
| 2541 | + fallthrough; |
---|
2544 | 2542 | default: |
---|
2545 | 2543 | rc = FAILED; |
---|
2546 | 2544 | break; |
---|
.. | .. |
---|
3021 | 3019 | wait_event(cfg->reset_waitq, cfg->state != STATE_RESET); |
---|
3022 | 3020 | if (cfg->state == STATE_NORMAL) |
---|
3023 | 3021 | goto retry; |
---|
| 3022 | + fallthrough; |
---|
3024 | 3023 | default: |
---|
3025 | 3024 | /* Ideally should not happen */ |
---|
3026 | 3025 | dev_err(dev, "%s: Device is not ready, state=%d\n", |
---|
.. | .. |
---|
3085 | 3084 | |
---|
3086 | 3085 | if (mode >= MAX_HWQ_MODE) { |
---|
3087 | 3086 | dev_info(cfgdev, "Invalid HWQ steering mode.\n"); |
---|
3088 | | - return -EINVAL; |
---|
3089 | | - } |
---|
3090 | | - |
---|
3091 | | - if ((mode == HWQ_MODE_TAG) && !shost_use_blk_mq(shost)) { |
---|
3092 | | - dev_info(cfgdev, "SCSI-MQ is not enabled, use a different " |
---|
3093 | | - "HWQ steering mode.\n"); |
---|
3094 | 3087 | return -EINVAL; |
---|
3095 | 3088 | } |
---|
3096 | 3089 | |
---|
.. | .. |
---|
3180 | 3173 | .this_id = -1, |
---|
3181 | 3174 | .sg_tablesize = 1, /* No scatter gather support */ |
---|
3182 | 3175 | .max_sectors = CXLFLASH_MAX_SECTORS, |
---|
3183 | | - .use_clustering = ENABLE_CLUSTERING, |
---|
3184 | 3176 | .shost_attrs = cxlflash_host_attrs, |
---|
3185 | 3177 | .sdev_attrs = cxlflash_dev_attrs, |
---|
3186 | 3178 | }; |
---|
.. | .. |
---|
3289 | 3281 | * |
---|
3290 | 3282 | * Return: A string identifying the decoded host ioctl. |
---|
3291 | 3283 | */ |
---|
3292 | | -static char *decode_hioctl(int cmd) |
---|
| 3284 | +static char *decode_hioctl(unsigned int cmd) |
---|
3293 | 3285 | { |
---|
3294 | 3286 | switch (cmd) { |
---|
3295 | 3287 | case HT_CXLFLASH_LUN_PROVISION: |
---|
.. | .. |
---|
3539 | 3531 | if (likely(do_ioctl)) |
---|
3540 | 3532 | break; |
---|
3541 | 3533 | |
---|
3542 | | - /* fall through */ |
---|
| 3534 | + fallthrough; |
---|
3543 | 3535 | default: |
---|
3544 | 3536 | rc = -EINVAL; |
---|
3545 | 3537 | goto out; |
---|
.. | .. |
---|
3596 | 3588 | .owner = THIS_MODULE, |
---|
3597 | 3589 | .open = cxlflash_chr_open, |
---|
3598 | 3590 | .unlocked_ioctl = cxlflash_chr_ioctl, |
---|
3599 | | - .compat_ioctl = cxlflash_chr_ioctl, |
---|
| 3591 | + .compat_ioctl = compat_ptr_ioctl, |
---|
3600 | 3592 | }; |
---|
3601 | 3593 | |
---|
3602 | 3594 | /** |
---|