RE: [PATCH] isci: reformulate for_each_isci_host macro to fix an oops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday, January 16, 2014 2:16 PM Lukasz Dorau <lukasz.dorau@xxxxxxxxx> wrote:
> 
> The loop 'for' in macro 'for_each_isci_host' (drivers/scsi/isci/init.c:717)
> is executed more times than it can be. Regardless the condition:
>    'id < ARRAY_SIZE(to_pci_info(pdev)->hosts)' (drivers/scsi/isci/host.h:315)
> it is executed when id equals ARRAY_SIZE(to_pci_info(pdev)->hosts) too.
> (Remark: ARRAY_SIZE(to_pci_info(pdev)->hosts) always equals
> SCI_MAX_CONTROLLERS = 2)
> 
> It sounds crazy, but it is truth. I have checked it in the following way:
> I have added the line:
> 
>    printk(KERN_ERR ">>> (%d < %d) == %d \n", \
>           i, SCI_MAX_CONTROLLERS, (i < SCI_MAX_CONTROLLERS));
> 
> after the 'for_each_isci_host' macro in drivers/scsi/isci/init.c:701
> and received the following output:
> 
>    >>> (0 < 2) == 1
>    >>> (1 < 2) == 1
>    >>> (2 < 2) == 1
> 
> after issuing 'modprobe isci' command on platform with two SCU controllers
> (Patsburg D or T chipset required).
> The kernel was compiled using gcc version 4.8.2.
> 

Hi James,

Please disregard this patch.
It turned to be a GCC 4.8 bug:
http://marc.info/?l=linux-kernel&m=138998871911336&w=2

I will write a new patch.

Lukasz

��.n��������+%������w��{.n�����{������ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux