tree:
https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git megaraid.v3
head: 9369ca8fe8c5e0b78306ef343c6c1e1eaec77956
commit: 9187b657e2257f892f70f96ae1e79e3d64a2e712 [2/4] megaraid_mbox: add ioport support
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.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/hare/scsi-devel.git/commi...
git remote add hare-scsi-devel
https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel megaraid.v3
git checkout 9187b657e2257f892f70f96ae1e79e3d64a2e712
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
drivers/scsi/megaraid/megaraid_mbox.c: In function 'megaraid_probe_one':
drivers/scsi/megaraid/megaraid_mbox.c:447:30: error: 'PCI_CONF_AMISIG'
undeclared (first use in this function); did you mean 'PCI_CONF_AMISIG64'?
447 | pci_read_config_word(pdev, PCI_CONF_AMISIG, &magic);
| ^~~~~~~~~~~~~~~
| PCI_CONF_AMISIG64
drivers/scsi/megaraid/megaraid_mbox.c:447:30: note: each undeclared identifier is
reported only once for each function it appears in
drivers/scsi/megaraid/megaraid_mbox.c:448:16: error: 'HBA_SIGNATURE_471'
undeclared (first use in this function); did you mean 'HBA_SIGNATURE_64_BIT'?
448 | if (magic != HBA_SIGNATURE_471 && magic != HBA_SIGNATURE)
| ^~~~~~~~~~~~~~~~~
| HBA_SIGNATURE_64_BIT
drivers/scsi/megaraid/megaraid_mbox.c:448:46: error: 'HBA_SIGNATURE' undeclared
(first use in this function)
448 | if (magic != HBA_SIGNATURE_471 && magic != HBA_SIGNATURE)
| ^~~~~~~~~~~~~
drivers/scsi/megaraid/megaraid_mbox.c: In function 'megaraid_init_mbox':
> drivers/scsi/megaraid/megaraid_mbox.c:759:24: error: implicit
declaration of function 'ioremap_nocache'; did you mean 'ioremap_cache'?
[-Werror=implicit-function-declaration]
759 | raid_dev->baseaddr =
ioremap_nocache(raid_dev->baseport, 128);
| ^~~~~~~~~~~~~~~
| ioremap_cache
> drivers/scsi/megaraid/megaraid_mbox.c:759:22: warning: assignment
to 'void *' from 'int' makes pointer from integer without a cast
[-Wint-conversion]
759 | raid_dev->baseaddr =
ioremap_nocache(raid_dev->baseport, 128);
| ^
In file included from drivers/scsi/megaraid/megaraid_mbox.c:70:
drivers/scsi/megaraid/megaraid_mbox.c: In function 'mbox_post_cmd':
> drivers/scsi/megaraid/megaraid_mbox.h:265:36: error:
'adapter_t' {aka 'struct <anonymous>'} has no member named
'baseport'
265 | outb_p(ENABLE_INTR_BYTE, (adapter)->baseport +
TOGGLE_PORT)
| ^~
drivers/scsi/megaraid/megaraid_mbox.c:1455:3: note: in expansion of macro
'irq_enable'
1455 | irq_enable(adapter);
| ^~~~~~~~~~
drivers/scsi/megaraid/megaraid_mbox.h:254:31: error: 'adapter_t' {aka
'struct <anonymous>'} has no member named 'baseport'
254 | outb_p(ISSUE_BYTE, (adapter)->baseport + CMD_PORT)
| ^~
drivers/scsi/megaraid/megaraid_mbox.c:1456:3: note: in expansion of macro
'issue_command'
1456 | issue_command(adapter);
| ^~~~~~~~~~~~~
drivers/scsi/megaraid/megaraid_mbox.c: In function 'megaraid_ack_sequence':
> drivers/scsi/megaraid/megaraid_mbox.c:2102:4: error:
'byte' undeclared (first use in this function)
2102 | byte =
irq_state(adapter);
| ^~~~
In file included from drivers/scsi/megaraid/megaraid_mbox.c:70:
drivers/scsi/megaraid/megaraid_mbox.h:256:43: error: 'adapter_t' {aka
'struct <anonymous>'} has no member named 'baseport'
256 | #define irq_state(adapter) inb_p((adapter)->baseport + INTR_PORT)
| ^~
drivers/scsi/megaraid/megaraid_mbox.c:2102:11: note: in expansion of macro
'irq_state'
2102 | byte = irq_state(adapter);
| ^~~~~~~~~
drivers/scsi/megaraid/megaraid_mbox.h:259:28: error: 'adapter_t' {aka
'struct <anonymous>'} has no member named 'baseport'
259 | outb_p((value), (adapter)->baseport + INTR_PORT)
| ^~
drivers/scsi/megaraid/megaraid_mbox.c:2106:4: note: in expansion of macro
'set_irq_state'
2106 | set_irq_state(adapter, byte);
| ^~~~~~~~~~~~~
drivers/scsi/megaraid/megaraid_mbox.h:262:29: error: 'adapter_t' {aka
'struct <anonymous>'} has no member named 'baseport'
262 | outb_p(ACK_BYTE, (adapter)->baseport + ACK_PORT)
| ^~
drivers/scsi/megaraid/megaraid_mbox.c:2159:4: note: in expansion of macro
'irq_ack'
2159 | irq_ack(adapter);
| ^~~~~~~
drivers/scsi/megaraid/megaraid_mbox.c: In function 'mbox_post_sync_cmd':
drivers/scsi/megaraid/megaraid_mbox.h:268:37: error: 'adapter_t' {aka
'struct <anonymous>'} has no member named 'baseport'
268 | outb_p(DISABLE_INTR_BYTE, (adapter)->baseport + TOGGLE_PORT)
| ^~
drivers/scsi/megaraid/megaraid_mbox.c:2739:3: note: in expansion of macro
'irq_disable'
2739 | irq_disable(adapter);
| ^~~~~~~~~~~
drivers/scsi/megaraid/megaraid_mbox.h:254:31: error: 'adapter_t' {aka
'struct <anonymous>'} has no member named 'baseport'
254 | outb_p(ISSUE_BYTE, (adapter)->baseport + CMD_PORT)
| ^~
drivers/scsi/megaraid/megaraid_mbox.c:2740:3: note: in expansion of macro
'issue_command'
2740 | issue_command(adapter);
| ^~~~~~~~~~~~~
drivers/scsi/megaraid/megaraid_mbox.c:2742:13: error: 'byte' undeclared (first
use in this function)
2742 | while (!((byte = irq_state(adapter)) & INTR_VALID))
| ^~~~
In file included from drivers/scsi/megaraid/megaraid_mbox.c:70:
drivers/scsi/megaraid/megaraid_mbox.h:256:43: error: 'adapter_t' {aka
'struct <anonymous>'} has no member named 'baseport'
256 | #define irq_state(adapter) inb_p((adapter)->baseport + INTR_PORT)
| ^~
drivers/scsi/megaraid/megaraid_mbox.c:2742:20: note: in expansion of macro
'irq_state'
2742 | while (!((byte = irq_state(adapter)) & INTR_VALID))
| ^~~~~~~~~
> drivers/scsi/megaraid/megaraid_mbox.c:2742:42: error:
'INTR_VALID' undeclared (first use in this function)
2742 | while
(!((byte = irq_state(adapter)) & INTR_VALID))
| ^~~~~~~~~~
In file included from drivers/scsi/megaraid/megaraid_mbox.c:70:
drivers/scsi/megaraid/megaraid_mbox.h:259:28: error: 'adapter_t' {aka
'struct <anonymous>'} has no member named 'baseport'
259 | outb_p((value), (adapter)->baseport + INTR_PORT)
| ^~
drivers/scsi/megaraid/megaraid_mbox.c:2745:3: note: in expansion of macro
'set_irq_state'
2745 | set_irq_state(adapter, byte);
| ^~~~~~~~~~~~~
> drivers/scsi/megaraid/megaraid_mbox.h:265:36: error:
'adapter_t' {aka 'struct <anonymous>'} has no member named
'baseport'
265 | outb_p(ENABLE_INTR_BYTE, (adapter)->baseport +
TOGGLE_PORT)
| ^~
drivers/scsi/megaraid/megaraid_mbox.c:2746:3: note: in expansion of macro
'irq_enable'
2746 | irq_enable(adapter);
| ^~~~~~~~~~
drivers/scsi/megaraid/megaraid_mbox.h:262:29: error: 'adapter_t' {aka
'struct <anonymous>'} has no member named 'baseport'
262 | outb_p(ACK_BYTE, (adapter)->baseport + ACK_PORT)
| ^~
drivers/scsi/megaraid/megaraid_mbox.c:2747:3: note: in expansion of macro
'irq_ack'
2747 | irq_ack(adapter);
| ^~~~~~~
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for FRAME_POINTER
Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
Selected by
- FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS &&
STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390
&& !MICROBLAZE && !ARM && !ARC && !X86
vim +759 drivers/scsi/megaraid/megaraid_mbox.c
703
704
705 /*
706 * START: Mailbox Low Level Driver
707 *
708 * This is section specific to the single mailbox based controllers
709 */
710
711 /**
712 * megaraid_init_mbox - initialize controller
713 * @adapter : our soft state
714 *
715 * - Allocate 16-byte aligned mailbox memory for firmware handshake
716 * - Allocate controller's memory resources
717 * - Find out all initialization data
718 * - Allocate memory required for all the commands
719 * - Use internal library of FW routines, build up complete soft state
720 */
721 static int
722 megaraid_init_mbox(adapter_t *adapter)
723 {
724 struct pci_dev *pdev;
725 mraid_device_t *raid_dev;
726 int i;
727 uint32_t magic64;
728
729
730 adapter->ito = MBOX_TIMEOUT;
731 pdev = adapter->pdev;
732
733 /*
734 * Allocate and initialize the init data structure for mailbox
735 * controllers
736 */
737 raid_dev = kzalloc(sizeof(mraid_device_t), GFP_KERNEL);
738 if (raid_dev == NULL) return -1;
739
740
741 /*
742 * Attach the adapter soft state to raid device soft state
743 */
744 adapter->raid_device = (caddr_t)raid_dev;
745 raid_dev->fast_load = megaraid_fast_load;
746
747
748 // our baseport
749 raid_dev->baseport = pci_resource_start(pdev, 0);
750
751 if (pci_request_regions(pdev, "MegaRAID: LSI Logic Corporation") != 0)
{
752
753 con_log(CL_ANN, (KERN_WARNING
754 "megaraid: mem region busy\n"));
755
756 goto out_free_raid_dev;
757 }
758 if (pci_resource_flags(pdev, 0) & IORESOURCE_MEM) {
759 raid_dev->baseaddr = ioremap_nocache(raid_dev->baseport,
128);
760
761 if (!raid_dev->baseaddr) {
762 con_log(CL_ANN, (KERN_WARNING
763 "megaraid: could not map hba memory\n") );
764
765 goto out_release_regions;
766 }
767 } else {
768 raid_dev->baseport += 0x10;
769 raid_dev->baseaddr = NULL;
770 }
771 /* initialize the mutual exclusion lock for the mailbox */
772 spin_lock_init(&raid_dev->mailbox_lock);
773
774 /* allocate memory required for commands */
775 if (megaraid_alloc_cmd_packets(adapter) != 0)
776 goto out_iounmap;
777
778 /*
779 * Issue SYNC cmd to flush the pending cmds in the adapter
780 * and initialize its internal state
781 */
782
783 if (raid_dev->baseaddr)
784 if (megaraid_mbox_fire_sync_cmd(adapter))
785 con_log(CL_ANN, ("megaraid: sync cmd failed\n"));
786
787 /*
788 * Setup the rest of the soft state using the library of
789 * FW routines
790 */
791
792 /* request IRQ and register the interrupt service routine */
793 if (request_irq(adapter->irq, megaraid_isr, IRQF_SHARED, "megaraid",
794 adapter)) {
795
796 con_log(CL_ANN, (KERN_WARNING
797 "megaraid: Couldn't register IRQ %d!\n", adapter->irq));
798 goto out_alloc_cmds;
799
800 }
801
802 // Product info
803 if (megaraid_mbox_product_info(adapter) != 0)
804 goto out_free_irq;
805
806 // Do we support extended CDBs
807 adapter->max_cdb_sz = 10;
808 if (megaraid_mbox_extended_cdb(adapter) == 0) {
809 adapter->max_cdb_sz = 16;
810 }
811
812 /*
813 * Do we support cluster environment, if we do, what is the initiator
814 * id.
815 * NOTE: In a non-cluster aware firmware environment, the LLD should
816 * return 7 as initiator id.
817 */
818 adapter->ha = 0;
819 adapter->init_id = -1;
820 if (megaraid_mbox_support_ha(adapter, &adapter->init_id) == 0) {
821 adapter->ha = 1;
822 }
823
824 /*
825 * Prepare the device ids array to have the mapping between the kernel
826 * device address and megaraid device address.
827 * We export the physical devices on their actual addresses. The
828 * logical drives are exported on a virtual SCSI channel
829 */
830 megaraid_mbox_setup_device_map(adapter);
831
832 // If the firmware supports random deletion, update the device id map
833 if (megaraid_mbox_support_random_del(adapter)) {
834
835 // Change the logical drives numbers in device_ids array one
836 // slot in device_ids is reserved for target id, that's why
837 // "<=" below
838 for (i = 0; i <= MAX_LOGICAL_DRIVES_40LD; i++) {
839 adapter->device_ids[adapter->max_channel][i] += 0x80;
840 }
841 adapter->device_ids[adapter->max_channel][adapter->init_id] =
842 0xFF;
843
844 raid_dev->random_del_supported = 1;
845 }
846
847 /*
848 * find out the maximum number of scatter-gather elements supported by
849 * this firmware
850 */
851 adapter->sglen = megaraid_mbox_get_max_sg(adapter);
852
853 // enumerate RAID and SCSI channels so that all devices on SCSI
854 // channels can later be exported, including disk devices
855 megaraid_mbox_enum_raid_scsi(adapter);
856
857 /*
858 * Other parameters required by upper layer
859 *
860 * maximum number of sectors per IO command
861 */
862 adapter->max_sectors = megaraid_max_sectors;
863
864 /*
865 * number of queued commands per LUN.
866 */
867 adapter->cmd_per_lun = megaraid_cmd_per_lun;
868
869 /*
870 * Allocate resources required to issue FW calls, when sysfs is
871 * accessed
872 */
873 if (megaraid_sysfs_alloc_resources(adapter) != 0)
874 goto out_free_irq;
875
876 // Set the DMA mask to 64-bit. All supported controllers as capable of
877 // DMA in this range
878 pci_read_config_dword(adapter->pdev, PCI_CONF_AMISIG64, &magic64);
879
880 if (((magic64 == HBA_SIGNATURE_64_BIT) &&
881 ((adapter->pdev->subsystem_device !=
882 PCI_SUBSYS_ID_MEGARAID_SATA_150_6) &&
883 (adapter->pdev->subsystem_device !=
884 PCI_SUBSYS_ID_MEGARAID_SATA_150_4))) ||
885 (adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
886 adapter->pdev->device == PCI_DEVICE_ID_VERDE) ||
887 (adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
888 adapter->pdev->device == PCI_DEVICE_ID_DOBSON) ||
889 (adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
890 adapter->pdev->device == PCI_DEVICE_ID_LINDSAY) ||
891 (adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
892 adapter->pdev->device == PCI_DEVICE_ID_PERC4_DI_EVERGLADES) ||
893 (adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
894 adapter->pdev->device == PCI_DEVICE_ID_PERC4E_DI_KOBUK)) {
895 if (dma_set_mask(&adapter->pdev->dev, DMA_BIT_MASK(64))) {
896 con_log(CL_ANN, (KERN_WARNING
897 "megaraid: DMA mask for 64-bit failed\n"));
898
899 if (dma_set_mask(&adapter->pdev->dev,
900 DMA_BIT_MASK(32))) {
901 con_log(CL_ANN, (KERN_WARNING
902 "megaraid: 32-bit DMA mask failed\n"));
903 goto out_free_sysfs_res;
904 }
905 }
906 }
907
908 // setup tasklet for DPC
909 tasklet_init(&adapter->dpc_h, megaraid_mbox_dpc,
910 (unsigned long)adapter);
911
912 con_log(CL_DLEVEL1, (KERN_INFO
913 "megaraid mbox hba successfully initialized\n"));
914
915 return 0;
916
917 out_free_sysfs_res:
918 megaraid_sysfs_free_resources(adapter);
919 out_free_irq:
920 free_irq(adapter->irq, adapter);
921 out_alloc_cmds:
922 megaraid_free_cmd_packets(adapter);
923 out_iounmap:
924 if (raid_dev->baseaddr)
925 iounmap(raid_dev->baseaddr);
926 out_release_regions:
927 pci_release_regions(pdev);
928 out_free_raid_dev:
929 kfree(raid_dev);
930
931 return -1;
932 }
933
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org