[linux-stable-rc:linux-4.14.y 713/1071] drivers/ata/libata-scsi.c:2424:30: error: 'SECTOR_SHIFT' undeclared; did you mean 'SOFTIRQ_SHIFT'?

From: kernel test robot
Date: Fri Aug 06 2021 - 14:09:36 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.14.y
head: af37e8ff299b6807fa85fde68b814a94f56a76b6
commit: 7819f78f87e0f0ec3347a7a98f8b671931c2f11b [713/1071] libata: implement ATA_HORKAGE_MAX_TRIM_128M and apply to Sandisks
config: powerpc-randconfig-r026-20210804 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=7819f78f87e0f0ec3347a7a98f8b671931c2f11b
git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-4.14.y
git checkout 7819f78f87e0f0ec3347a7a98f8b671931c2f11b
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/ata/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

| ^~~~~~~~~~~
include/scsi/scsi_cmnd.h:213:16: error: invalid use of undefined type 'struct request'
213 | (cmd->request->next_rq->special != NULL);
| ^~
include/scsi/scsi_cmnd.h: In function 'scsi_in':
include/scsi/scsi_cmnd.h:219:15: error: invalid use of undefined type 'struct request'
219 | cmd->request->next_rq->special : &cmd->sdb;
| ^~
include/scsi/scsi_cmnd.h: In function 'scsi_get_lba':
include/scsi/scsi_cmnd.h:305:9: error: implicit declaration of function 'blk_rq_pos' [-Werror=implicit-function-declaration]
305 | return blk_rq_pos(scmd->request);
| ^~~~~~~~~~
In file included from include/linux/writeback.h:13,
from include/linux/memcontrol.h:31,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from drivers/ata/libata-scsi.c:51:
include/linux/blk_types.h: At top level:
include/linux/blk_types.h:28:22: error: conflicting types for 'blk_status_t'
28 | typedef u8 __bitwise blk_status_t;
| ^~~~~~~~~~~~
In file included from include/scsi/scsi_host.h:11,
from drivers/ata/libata-scsi.c:42:
include/linux/blk-mq.h:92:9: note: previous declaration of 'blk_status_t' was here
92 | typedef blk_status_t (queue_rq_fn)(struct blk_mq_hw_ctx *,
| ^~~~~~~~~~~~
drivers/ata/libata-scsi.c: In function 'ata_scsi_qc_new':
drivers/ata/libata-scsi.c:867:40: error: invalid use of undefined type 'struct request'
867 | qc = ata_qc_new_init(dev, cmd->request->tag);
| ^~
drivers/ata/libata-scsi.c: In function 'ata_qc_set_pc_nbytes':
drivers/ata/libata-scsi.c:886:32: error: invalid use of undefined type 'struct request'
886 | qc->extrabytes = scmd->request->extra_len;
| ^~
In file included from include/asm-generic/bug.h:5,
from arch/powerpc/include/asm/bug.h:128,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from include/linux/slab.h:15,
from drivers/ata/libata-scsi.c:36:
drivers/ata/libata-scsi.c: In function 'atapi_drain_needed':
drivers/ata/libata-scsi.c:1256:14: error: implicit declaration of function 'blk_rq_is_passthrough' [-Werror=implicit-function-declaration]
1256 | if (likely(!blk_rq_is_passthrough(rq)))
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:76:40: note: in definition of macro 'likely'
76 | # define likely(x) __builtin_expect(!!(x), 1)
| ^
drivers/ata/libata-scsi.c:1259:7: error: implicit declaration of function 'blk_rq_bytes' [-Werror=implicit-function-declaration]
1259 | if (!blk_rq_bytes(rq) || op_is_write(req_op(rq)))
| ^~~~~~~~~~~~
In file included from include/linux/writeback.h:13,
from include/linux/memcontrol.h:31,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from drivers/ata/libata-scsi.c:51:
include/linux/blk_types.h:266:8: error: invalid use of undefined type 'struct request'
266 | ((req)->cmd_flags & REQ_OP_MASK)
| ^~
drivers/ata/libata-scsi.c:1259:39: note: in expansion of macro 'req_op'
1259 | if (!blk_rq_bytes(rq) || op_is_write(req_op(rq)))
| ^~~~~~
drivers/ata/libata-scsi.c: In function 'ata_scsi_dev_config':
drivers/ata/libata-scsi.c:1274:2: error: implicit declaration of function 'blk_queue_max_hw_sectors' [-Werror=implicit-function-declaration]
1274 | blk_queue_max_hw_sectors(q, dev->max_sectors);
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/ata/libata-scsi.c:1282:3: error: implicit declaration of function 'blk_queue_update_dma_pad' [-Werror=implicit-function-declaration]
1282 | blk_queue_update_dma_pad(q, ATA_DMA_PAD_SZ - 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/ata/libata-scsi.c:1285:35: error: invalid use of undefined type 'struct request_queue'
1285 | buf = kmalloc(ATAPI_MAX_DRAIN, q->bounce_gfp | GFP_KERNEL);
| ^~
drivers/ata/libata-scsi.c:1291:3: error: implicit declaration of function 'blk_queue_dma_drain' [-Werror=implicit-function-declaration]
1291 | blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN);
| ^~~~~~~~~~~~~~~~~~~
drivers/ata/libata-scsi.c:1309:2: error: implicit declaration of function 'blk_queue_update_dma_alignment' [-Werror=implicit-function-declaration]
1309 | blk_queue_update_dma_alignment(q, sdev->sector_size - 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/ata/libata-scsi.c:1322:2: error: implicit declaration of function 'blk_queue_flush_queueable' [-Werror=implicit-function-declaration]
1322 | blk_queue_flush_queueable(q, false);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/ata/libata-scsi.c: In function 'ata_scsi_slave_destroy':
drivers/ata/libata-scsi.c:1391:9: error: invalid use of undefined type 'struct request_queue'
1391 | kfree(q->dma_drain_buffer);
| ^~
drivers/ata/libata-scsi.c:1392:3: error: invalid use of undefined type 'struct request_queue'
1392 | q->dma_drain_buffer = NULL;
| ^~
drivers/ata/libata-scsi.c:1393:3: error: invalid use of undefined type 'struct request_queue'
1393 | q->dma_drain_size = 0;
| ^~
In file included from drivers/ata/libata-scsi.c:53:
drivers/ata/libata-scsi.c: In function 'ata_scsi_rw_xlat':
drivers/ata/libata-scsi.c:1845:32: error: implicit declaration of function 'req_get_ioprio' [-Werror=implicit-function-declaration]
1845 | int class = IOPRIO_PRIO_CLASS(req_get_ioprio(rq));
| ^~~~~~~~~~~~~~
include/linux/ioprio.h:14:35: note: in definition of macro 'IOPRIO_PRIO_CLASS'
14 | #define IOPRIO_PRIO_CLASS(mask) ((mask) >> IOPRIO_CLASS_SHIFT)
| ^~~~
drivers/ata/libata-scsi.c: In function 'ata_scsiop_inq_b0':
>> drivers/ata/libata-scsi.c:2424:30: error: 'SECTOR_SHIFT' undeclared (first use in this function); did you mean 'SOFTIRQ_SHIFT'?
2424 | max_blocks = 128 << (20 - SECTOR_SHIFT);
| ^~~~~~~~~~~~
| SOFTIRQ_SHIFT
drivers/ata/libata-scsi.c:2424:30: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors


vim +2424 drivers/ata/libata-scsi.c

2392
2393 static unsigned int ata_scsiop_inq_b0(struct ata_scsi_args *args, u8 *rbuf)
2394 {
2395 struct ata_device *dev = args->dev;
2396 u16 min_io_sectors;
2397
2398 rbuf[1] = 0xb0;
2399 rbuf[3] = 0x3c; /* required VPD size with unmap support */
2400
2401 /*
2402 * Optimal transfer length granularity.
2403 *
2404 * This is always one physical block, but for disks with a smaller
2405 * logical than physical sector size we need to figure out what the
2406 * latter is.
2407 */
2408 min_io_sectors = 1 << ata_id_log2_per_physical_sector(args->id);
2409 put_unaligned_be16(min_io_sectors, &rbuf[6]);
2410
2411 /*
2412 * Optimal unmap granularity.
2413 *
2414 * The ATA spec doesn't even know about a granularity or alignment
2415 * for the TRIM command. We can leave away most of the unmap related
2416 * VPD page entries, but we have specifify a granularity to signal
2417 * that we support some form of unmap - in thise case via WRITE SAME
2418 * with the unmap bit set.
2419 */
2420 if (ata_id_has_trim(args->id)) {
2421 u64 max_blocks = 65535 * ATA_MAX_TRIM_RNUM;
2422
2423 if (dev->horkage & ATA_HORKAGE_MAX_TRIM_128M)
> 2424 max_blocks = 128 << (20 - SECTOR_SHIFT);
2425
2426 put_unaligned_be64(max_blocks, &rbuf[36]);
2427 put_unaligned_be32(1, &rbuf[28]);
2428 }
2429
2430 return 0;
2431 }
2432

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip