Re: [PATCH] dvb-usb: Add memory free on error path in dw2102_probe()
For me it's fine. Reviewed-By: Enrico Mioso <mrkiko...@gmail.com> On Thu, 10 Aug 2017, Anton Vasilyev wrote: Date: Thu, 10 Aug 2017 17:27:44 From: Anton Vasilyev <vasil...@ispras.ru> To: Mauro Carvalho Chehab <mche...@kernel.org> Cc: Anton Vasilyev <vasil...@ispras.ru>, Jonathan McDowell <nood...@earth.li>, Alyssa Milburn <amilb...@zall.org>, Enrico Mioso <mrkiko...@gmail.com>, linux-me...@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-proj...@linuxtesting.org Subject: [PATCH] dvb-usb: Add memory free on error path in dw2102_probe() If dw2102_probe() fails on dvb_usb_device_init(), then memleak occurs. The patch adds deallocation to the error path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev <vasil...@ispras.ru> --- drivers/media/usb/dvb-usb/dw2102.c | 39 +- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c index 6e654e5..0d63693 100644 --- a/drivers/media/usb/dvb-usb/dw2102.c +++ b/drivers/media/usb/dvb-usb/dw2102.c @@ -2332,10 +2332,12 @@ static struct dvb_usb_device_properties tt_s2_4600_properties = { static int dw2102_probe(struct usb_interface *intf, const struct usb_device_id *id) { + int retval = -ENOMEM; p1100 = kmemdup(_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); if (!p1100) - return -ENOMEM; + goto err0; + /* copy default structure */ /* fill only different fields */ p1100->firmware = P1100_FIRMWARE; @@ -2346,10 +2348,9 @@ static int dw2102_probe(struct usb_interface *intf, s660 = kmemdup(_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); - if (!s660) { - kfree(p1100); - return -ENOMEM; - } + if (!s660) + goto err1; + s660->firmware = S660_FIRMWARE; s660->num_device_descs = 3; s660->devices[0] = d660; @@ -2359,11 +2360,9 @@ static int dw2102_probe(struct usb_interface *intf, p7500 = kmemdup(_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); - if (!p7500) { - kfree(p1100); - kfree(s660); - return -ENOMEM; - } + if (!p7500) + goto err2; + p7500->firmware = P7500_FIRMWARE; p7500->devices[0] = d7500; p7500->rc.core.rc_query = prof_rc_query; @@ -2373,12 +2372,9 @@ static int dw2102_probe(struct usb_interface *intf, s421 = kmemdup(_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); - if (!s421) { - kfree(p1100); - kfree(s660); - kfree(p7500); - return -ENOMEM; - } + if (!s421) + goto err3; + s421->num_device_descs = 2; s421->devices[0] = d421; s421->devices[1] = d632; @@ -2408,7 +2404,16 @@ static int dw2102_probe(struct usb_interface *intf, THIS_MODULE, NULL, adapter_nr)) return 0; - return -ENODEV; + retval = -ENODEV; + kfree(s421); +err3: + kfree(p7500); +err2: + kfree(s660); +err1: + kfree(p1100); +err0: + return retval; } static void dw2102_disconnect(struct usb_interface *intf) -- 2.7.4
Re: [PATCH] dvb-usb: Add memory free on error path in dw2102_probe()
For me it's fine. Reviewed-By: Enrico Mioso On Thu, 10 Aug 2017, Anton Vasilyev wrote: Date: Thu, 10 Aug 2017 17:27:44 From: Anton Vasilyev To: Mauro Carvalho Chehab Cc: Anton Vasilyev , Jonathan McDowell , Alyssa Milburn , Enrico Mioso , linux-me...@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-proj...@linuxtesting.org Subject: [PATCH] dvb-usb: Add memory free on error path in dw2102_probe() If dw2102_probe() fails on dvb_usb_device_init(), then memleak occurs. The patch adds deallocation to the error path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev --- drivers/media/usb/dvb-usb/dw2102.c | 39 +- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c index 6e654e5..0d63693 100644 --- a/drivers/media/usb/dvb-usb/dw2102.c +++ b/drivers/media/usb/dvb-usb/dw2102.c @@ -2332,10 +2332,12 @@ static struct dvb_usb_device_properties tt_s2_4600_properties = { static int dw2102_probe(struct usb_interface *intf, const struct usb_device_id *id) { + int retval = -ENOMEM; p1100 = kmemdup(_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); if (!p1100) - return -ENOMEM; + goto err0; + /* copy default structure */ /* fill only different fields */ p1100->firmware = P1100_FIRMWARE; @@ -2346,10 +2348,9 @@ static int dw2102_probe(struct usb_interface *intf, s660 = kmemdup(_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); - if (!s660) { - kfree(p1100); - return -ENOMEM; - } + if (!s660) + goto err1; + s660->firmware = S660_FIRMWARE; s660->num_device_descs = 3; s660->devices[0] = d660; @@ -2359,11 +2360,9 @@ static int dw2102_probe(struct usb_interface *intf, p7500 = kmemdup(_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); - if (!p7500) { - kfree(p1100); - kfree(s660); - return -ENOMEM; - } + if (!p7500) + goto err2; + p7500->firmware = P7500_FIRMWARE; p7500->devices[0] = d7500; p7500->rc.core.rc_query = prof_rc_query; @@ -2373,12 +2372,9 @@ static int dw2102_probe(struct usb_interface *intf, s421 = kmemdup(_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); - if (!s421) { - kfree(p1100); - kfree(s660); - kfree(p7500); - return -ENOMEM; - } + if (!s421) + goto err3; + s421->num_device_descs = 2; s421->devices[0] = d421; s421->devices[1] = d632; @@ -2408,7 +2404,16 @@ static int dw2102_probe(struct usb_interface *intf, THIS_MODULE, NULL, adapter_nr)) return 0; - return -ENODEV; + retval = -ENODEV; + kfree(s421); +err3: + kfree(p7500); +err2: + kfree(s660); +err1: + kfree(p1100); +err0: + return retval; } static void dw2102_disconnect(struct usb_interface *intf) -- 2.7.4
EXT4-fs (sdc1): Delayed block allocation failed ...
Hello. I am getting a single error message, similar to what happens in https://patchwork.kernel.org/patch/9460075/ EXT4-fs (sdc1): Delayed block allocation failed for inode 27155438 at logical offset 6561 with max blocks 6 with error 121 EXT4-fs (sdc1): This should not happen!! Data will be lost The /dev/sdc device in question is a Samsung Portable Disk, my complete lsusb for this device follows. Currently running kernel is 4.12.3-1-ARCH, 32-bit machine. Thanks very much to all guys, Enrico ---lsusb--- Bus 001 Device 008: ID 04e8:61b3 Samsung Electronics Co., Ltd Device Descriptor: bLength18 bDescriptorType 1 bcdUSB 2.10 bDeviceClass0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize064 idVendor 0x04e8 Samsung Electronics Co., Ltd idProduct 0x61b3 bcdDevice 13.06 iManufacturer 1 Samsung M3 Portable iProduct2 Samsung M3 Portable iSerial 3 C0747E011D68 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 85 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xc0 Self Powered MaxPower 30mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 8 Mass Storage bInterfaceSubClass 6 SCSI bInterfaceProtocol 80 Bulk-Only iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber0 bAlternateSetting 1 bNumEndpoints 4 bInterfaceClass 8 Mass Storage bInterfaceSubClass 6 SCSI bInterfaceProtocol 98 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Command pipe (0x01) Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Status pipe (0x02) Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Data-in pipe (0x03) Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x04 EP 4 OUT bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Data-out pipe (0x04) Binary Object Store Descriptor: bLength 5 bDescriptorType15 wTotalLength 22 bNumDeviceCaps 2 USB 2.0 Extension Device Capability: bLength 7 bDescriptorType16 bDevCapabilityType 2 bmAttributes 0x0f0e BESL Link Power Management (LPM) Supported BESL value 3840 us SuperSpeed USB Device Capability: bLength10 bDescriptorType16 bDevCapabilityType 3 bmAttributes 0x00 wSpeedsSupported 0x000e Device can operate
EXT4-fs (sdc1): Delayed block allocation failed ...
Hello. I am getting a single error message, similar to what happens in https://patchwork.kernel.org/patch/9460075/ EXT4-fs (sdc1): Delayed block allocation failed for inode 27155438 at logical offset 6561 with max blocks 6 with error 121 EXT4-fs (sdc1): This should not happen!! Data will be lost The /dev/sdc device in question is a Samsung Portable Disk, my complete lsusb for this device follows. Currently running kernel is 4.12.3-1-ARCH, 32-bit machine. Thanks very much to all guys, Enrico ---lsusb--- Bus 001 Device 008: ID 04e8:61b3 Samsung Electronics Co., Ltd Device Descriptor: bLength18 bDescriptorType 1 bcdUSB 2.10 bDeviceClass0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize064 idVendor 0x04e8 Samsung Electronics Co., Ltd idProduct 0x61b3 bcdDevice 13.06 iManufacturer 1 Samsung M3 Portable iProduct2 Samsung M3 Portable iSerial 3 C0747E011D68 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 85 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xc0 Self Powered MaxPower 30mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 8 Mass Storage bInterfaceSubClass 6 SCSI bInterfaceProtocol 80 Bulk-Only iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber0 bAlternateSetting 1 bNumEndpoints 4 bInterfaceClass 8 Mass Storage bInterfaceSubClass 6 SCSI bInterfaceProtocol 98 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Command pipe (0x01) Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Status pipe (0x02) Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Data-in pipe (0x03) Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x04 EP 4 OUT bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Data-out pipe (0x04) Binary Object Store Descriptor: bLength 5 bDescriptorType15 wTotalLength 22 bNumDeviceCaps 2 USB 2.0 Extension Device Capability: bLength 7 bDescriptorType16 bDevCapabilityType 2 bmAttributes 0x0f0e BESL Link Power Management (LPM) Supported BESL value 3840 us SuperSpeed USB Device Capability: bLength10 bDescriptorType16 bDevCapabilityType 3 bmAttributes 0x00 wSpeedsSupported 0x000e Device can operate
I915 dmesg warnings on Mac Mini, solo core edition
Hello. I am not using this computer actively and can't report easily on the state of the screen. Still, I observed the following situation in the system's dmesg: running the stock Archlinux Kernel. This is an Apple MacMini system, booted via an EFI bootloader. Thank you very much, Enrico [0.00] Linux version 4.9.11-1-ARCH (builduser@heftig-17178) (gcc version 6.3.1 20170109 (GCC) ) #1 SMP PREEMPT Sun Feb 19 14:09:53 UTC 2017 [0.00] Disabled fast string operations [0.00] x86/fpu: Legacy x87 FPU detected. [0.00] x86/fpu: Using 'eager' FPU context switches. [0.00] e820: BIOS-provided physical RAM map: [0.00] BIOS-e820: [mem 0x-0x0008efff] usable [0.00] BIOS-e820: [mem 0x0008f000-0x0008] ACPI NVS [0.00] BIOS-e820: [mem 0x0009-0x0009] usable [0.00] BIOS-e820: [mem 0x0010-0x1e0c9fff] usable [0.00] BIOS-e820: [mem 0x1e0ca000-0x1e2cafff] ACPI NVS [0.00] BIOS-e820: [mem 0x1e2cb000-0x1ee3dfff] usable [0.00] BIOS-e820: [mem 0x1ee3e000-0x1ee63fff] reserved [0.00] BIOS-e820: [mem 0x1ee64000-0x1ee7efff] usable [0.00] BIOS-e820: [mem 0x1ee7f000-0x1eeaafff] reserved [0.00] BIOS-e820: [mem 0x1eeab000-0x1eeb4fff] usable [0.00] BIOS-e820: [mem 0x1eeb5000-0x1eeb7fff] ACPI data [0.00] BIOS-e820: [mem 0x1eeb8000-0x1eeb9fff] ACPI NVS [0.00] BIOS-e820: [mem 0x1eeba000-0x1eebafff] ACPI data [0.00] BIOS-e820: [mem 0x1eebb000-0x1fff] ACPI NVS [0.00] BIOS-e820: [mem 0x1eeef000-0x1eefefff] ACPI data [0.00] BIOS-e820: [mem 0x1eeff000-0x1eef] reserved [0.00] BIOS-e820: [mem 0xe00f8000-0xe00f8fff] reserved [0.00] BIOS-e820: [mem 0xfed1c000-0xfed1] reserved [0.00] BIOS-e820: [mem 0xfffb-0xfffd] reserved [0.00] Notice: NX (Execute Disable) protection cannot be enabled: non-PAE kernel! [0.00] e820: update [mem 0x1c311010-0x1c32103b] usable ==> usable [0.00] extended physical RAM map: [0.00] reserve setup_data: [mem 0x-0x0008efff] usable [0.00] reserve setup_data: [mem 0x0008f000-0x0008] ACPI NVS [0.00] reserve setup_data: [mem 0x0009-0x0009] usable [0.00] reserve setup_data: [mem 0x0010-0x1c31100f] usable [0.00] reserve setup_data: [mem 0x1c311010-0x1c32103b] usable [0.00] reserve setup_data: [mem 0x1c32103c-0x1e0c9fff] usable [0.00] reserve setup_data: [mem 0x1e0ca000-0x1e2cafff] ACPI NVS [0.00] reserve setup_data: [mem 0x1e2cb000-0x1ee3dfff] usable [0.00] reserve setup_data: [mem 0x1ee3e000-0x1ee63fff] reserved [0.00] reserve setup_data: [mem 0x1ee64000-0x1ee7efff] usable [0.00] reserve setup_data: [mem 0x1ee7f000-0x1eeaafff] reserved [0.00] reserve setup_data: [mem 0x1eeab000-0x1eeb4fff] usable [0.00] reserve setup_data: [mem 0x1eeb5000-0x1eeb7fff] ACPI data [0.00] reserve setup_data: [mem 0x1eeb8000-0x1eeb9fff] ACPI NVS [0.00] reserve setup_data: [mem 0x1eeba000-0x1eebafff] ACPI data [0.00] reserve setup_data: [mem 0x1eebb000-0x1fff] ACPI NVS [0.00] reserve setup_data: [mem 0x1eeef000-0x1eefefff] ACPI data [0.00] reserve setup_data: [mem 0x1eeff000-0x1eef] reserved [0.00] reserve setup_data: [mem 0xe00f8000-0xe00f8fff] reserved [0.00] reserve setup_data: [mem 0xfed1c000-0xfed1] reserved [0.00] reserve setup_data: [mem 0xfffb-0xfffd] reserved [0.00] efi: EFI v1.10 by Apple [0.00] efi: ACPI=0x1eefd000 ACPI 2.0=0x1eefd014 SMBIOS=0x1eeb9000 [0.00] SMBIOS 2.4 present. [0.00] DMI: Apple Computer, Inc. Macmini1,1/Mac-F4208EC8, BIOS MM11.88Z.0055.B08.0610121326 10/12/06 [0.00] e820: update [mem 0x-0x0fff] usable ==> reserved [0.00] e820: remove [mem 0x000a-0x000f] usable [0.00] e820: last_pfn = 0x1eeb5 max_arch_pfn = 0x10 [0.00] MTRR default type: uncachable [0.00] MTRR fixed ranges enabled: [0.00] 0-9 write-back [0.00] A-B uncachable [0.00] C-C write-protect [0.00] D-D uncachable [0.00] E-F write-protect [0.00] MTRR variable
I915 dmesg warnings on Mac Mini, solo core edition
Hello. I am not using this computer actively and can't report easily on the state of the screen. Still, I observed the following situation in the system's dmesg: running the stock Archlinux Kernel. This is an Apple MacMini system, booted via an EFI bootloader. Thank you very much, Enrico [0.00] Linux version 4.9.11-1-ARCH (builduser@heftig-17178) (gcc version 6.3.1 20170109 (GCC) ) #1 SMP PREEMPT Sun Feb 19 14:09:53 UTC 2017 [0.00] Disabled fast string operations [0.00] x86/fpu: Legacy x87 FPU detected. [0.00] x86/fpu: Using 'eager' FPU context switches. [0.00] e820: BIOS-provided physical RAM map: [0.00] BIOS-e820: [mem 0x-0x0008efff] usable [0.00] BIOS-e820: [mem 0x0008f000-0x0008] ACPI NVS [0.00] BIOS-e820: [mem 0x0009-0x0009] usable [0.00] BIOS-e820: [mem 0x0010-0x1e0c9fff] usable [0.00] BIOS-e820: [mem 0x1e0ca000-0x1e2cafff] ACPI NVS [0.00] BIOS-e820: [mem 0x1e2cb000-0x1ee3dfff] usable [0.00] BIOS-e820: [mem 0x1ee3e000-0x1ee63fff] reserved [0.00] BIOS-e820: [mem 0x1ee64000-0x1ee7efff] usable [0.00] BIOS-e820: [mem 0x1ee7f000-0x1eeaafff] reserved [0.00] BIOS-e820: [mem 0x1eeab000-0x1eeb4fff] usable [0.00] BIOS-e820: [mem 0x1eeb5000-0x1eeb7fff] ACPI data [0.00] BIOS-e820: [mem 0x1eeb8000-0x1eeb9fff] ACPI NVS [0.00] BIOS-e820: [mem 0x1eeba000-0x1eebafff] ACPI data [0.00] BIOS-e820: [mem 0x1eebb000-0x1fff] ACPI NVS [0.00] BIOS-e820: [mem 0x1eeef000-0x1eefefff] ACPI data [0.00] BIOS-e820: [mem 0x1eeff000-0x1eef] reserved [0.00] BIOS-e820: [mem 0xe00f8000-0xe00f8fff] reserved [0.00] BIOS-e820: [mem 0xfed1c000-0xfed1] reserved [0.00] BIOS-e820: [mem 0xfffb-0xfffd] reserved [0.00] Notice: NX (Execute Disable) protection cannot be enabled: non-PAE kernel! [0.00] e820: update [mem 0x1c311010-0x1c32103b] usable ==> usable [0.00] extended physical RAM map: [0.00] reserve setup_data: [mem 0x-0x0008efff] usable [0.00] reserve setup_data: [mem 0x0008f000-0x0008] ACPI NVS [0.00] reserve setup_data: [mem 0x0009-0x0009] usable [0.00] reserve setup_data: [mem 0x0010-0x1c31100f] usable [0.00] reserve setup_data: [mem 0x1c311010-0x1c32103b] usable [0.00] reserve setup_data: [mem 0x1c32103c-0x1e0c9fff] usable [0.00] reserve setup_data: [mem 0x1e0ca000-0x1e2cafff] ACPI NVS [0.00] reserve setup_data: [mem 0x1e2cb000-0x1ee3dfff] usable [0.00] reserve setup_data: [mem 0x1ee3e000-0x1ee63fff] reserved [0.00] reserve setup_data: [mem 0x1ee64000-0x1ee7efff] usable [0.00] reserve setup_data: [mem 0x1ee7f000-0x1eeaafff] reserved [0.00] reserve setup_data: [mem 0x1eeab000-0x1eeb4fff] usable [0.00] reserve setup_data: [mem 0x1eeb5000-0x1eeb7fff] ACPI data [0.00] reserve setup_data: [mem 0x1eeb8000-0x1eeb9fff] ACPI NVS [0.00] reserve setup_data: [mem 0x1eeba000-0x1eebafff] ACPI data [0.00] reserve setup_data: [mem 0x1eebb000-0x1fff] ACPI NVS [0.00] reserve setup_data: [mem 0x1eeef000-0x1eefefff] ACPI data [0.00] reserve setup_data: [mem 0x1eeff000-0x1eef] reserved [0.00] reserve setup_data: [mem 0xe00f8000-0xe00f8fff] reserved [0.00] reserve setup_data: [mem 0xfed1c000-0xfed1] reserved [0.00] reserve setup_data: [mem 0xfffb-0xfffd] reserved [0.00] efi: EFI v1.10 by Apple [0.00] efi: ACPI=0x1eefd000 ACPI 2.0=0x1eefd014 SMBIOS=0x1eeb9000 [0.00] SMBIOS 2.4 present. [0.00] DMI: Apple Computer, Inc. Macmini1,1/Mac-F4208EC8, BIOS MM11.88Z.0055.B08.0610121326 10/12/06 [0.00] e820: update [mem 0x-0x0fff] usable ==> reserved [0.00] e820: remove [mem 0x000a-0x000f] usable [0.00] e820: last_pfn = 0x1eeb5 max_arch_pfn = 0x10 [0.00] MTRR default type: uncachable [0.00] MTRR fixed ranges enabled: [0.00] 0-9 write-back [0.00] A-B uncachable [0.00] C-C write-protect [0.00] D-D uncachable [0.00] E-F write-protect [0.00] MTRR variable
Re: CPU Hotplugging disabled, still cpuhp/%d threads running in my 32-bit system
Thank you very much Thomas, really. Enrico Enrico Mioso Mobile Phone Number: +393807096934 ( +Telegram :) ) My Tox ID is: 7C593F402A3C8632D87AB4B948D492294C39A6A614464ECF843CA3429FB023284180472C7475 I like / recommend the usage of open messaging standards. On Wed, 11 Jan 2017, Thomas Gleixner wrote: Date: Wed, 11 Jan 2017 10:16:10 From: Thomas Gleixner <t...@linutronix.de> To: Enrico Mioso <mrkiko...@gmail.com> Cc: linux-kernel@vger.kernel.org, Boris Ostrovsky <boris.ostrov...@oracle.com>, Rasmus Villemoes <li...@rasmusvillemoes.dk>, Peter Zijlstra <pet...@infradead.org>, Anna-Maria Gleixner <anna-ma...@linutronix.de>, Ingo Molnar <mi...@kernel.org>, Sebastian Andrzej Siewior <bige...@linutronix.de> Subject: Re: CPU Hotplugging disabled, still cpuhp/%d threads running in my 32-bit system On Tue, 10 Jan 2017, Enrico Mioso wrote: Hello guys. I disabled CPU hotplugging in my .config: still I can see what follows in the process list. 11 ?S 0:00 [cpuhp/0] 12 ?S 0:00 [cpuhp/1] And from what I can see in kernel/cpu.c:574, this is related to CPU hotplugging. Is this normal? And, out of curiosity, why? Yes. We need the threads for bringing up the CPUs and for modules and other functionality to set up per cpu related things. The thread makes sure that the code runs on the CPUs and handles the functionality related to install/remove of hotplug callbacks. Thanks, tglx
Re: CPU Hotplugging disabled, still cpuhp/%d threads running in my 32-bit system
Thank you very much Thomas, really. Enrico Enrico Mioso Mobile Phone Number: +393807096934 ( +Telegram :) ) My Tox ID is: 7C593F402A3C8632D87AB4B948D492294C39A6A614464ECF843CA3429FB023284180472C7475 I like / recommend the usage of open messaging standards. On Wed, 11 Jan 2017, Thomas Gleixner wrote: Date: Wed, 11 Jan 2017 10:16:10 From: Thomas Gleixner To: Enrico Mioso Cc: linux-kernel@vger.kernel.org, Boris Ostrovsky , Rasmus Villemoes , Peter Zijlstra , Anna-Maria Gleixner , Ingo Molnar , Sebastian Andrzej Siewior Subject: Re: CPU Hotplugging disabled, still cpuhp/%d threads running in my 32-bit system On Tue, 10 Jan 2017, Enrico Mioso wrote: Hello guys. I disabled CPU hotplugging in my .config: still I can see what follows in the process list. 11 ?S 0:00 [cpuhp/0] 12 ?S 0:00 [cpuhp/1] And from what I can see in kernel/cpu.c:574, this is related to CPU hotplugging. Is this normal? And, out of curiosity, why? Yes. We need the threads for bringing up the CPUs and for modules and other functionality to set up per cpu related things. The thread makes sure that the code runs on the CPUs and handles the functionality related to install/remove of hotplug callbacks. Thanks, tglx
CPU Hotplugging disabled, still cpuhp/%d threads running in my 32-bit system
Hello guys. I disabled CPU hotplugging in my .config: still I can see what follows in the process list. 11 ?S 0:00 [cpuhp/0] 12 ?S 0:00 [cpuhp/1] And from what I can see in kernel/cpu.c:574, this is related to CPU hotplugging. Is this normal? And, out of curiosity, why? Running current branch (git) kernel, commit 2cfe8f8290bd28cf1ee67db914a6e76cf8e6437b . Thank you all guys, for your replies and everything, in advance. Enrico My .config: # # Automatically generated file; DO NOT EDIT. # Linux/x86 4.10.0-rc3 Kernel Configuration # # CONFIG_64BIT is not set CONFIG_X86_32=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_OUTPUT_FORMAT="elf32-i386" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_MMU=y CONFIG_ARCH_MMAP_RND_BITS_MIN=8 CONFIG_ARCH_MMAP_RND_BITS_MAX=16 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_X86_32_SMP=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_DEBUG_RODATA=y CONFIG_PGTABLE_LEVELS=2 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_EXTABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION="ho" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y # CONFIG_KERNEL_GZIP is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_LZMA is not set CONFIG_KERNEL_XZ=y # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set CONFIG_DEFAULT_HOSTNAME="(gato-saldo)" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_FHANDLE=y # CONFIG_USELIB is not set # CONFIG_AUDIT is not set CONFIG_HAVE_ARCH_AUDITSYSCALL=y # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y # CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_GENERIC_CMOS_UPDATE=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_IRQ_TIME_ACCOUNTING is not set CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y # CONFIG_TASK_XACCT is not set # # RCU Subsystem # CONFIG_TREE_RCU=y # CONFIG_RCU_EXPERT is not set CONFIG_SRCU=y # CONFIG_TASKS_RCU is not set CONFIG_RCU_STALL_COMMON=y CONFIG_TREE_RCU_TRACE=y # CONFIG_RCU_EXPEDITE_BOOT is not set CONFIG_BUILD_BIN2C=y CONFIG_IKCONFIG=m CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 CONFIG_NMI_LOG_BUF_SHIFT=13 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_CGROUPS=y CONFIG_PAGE_COUNTER=y CONFIG_MEMCG=y CONFIG_MEMCG_SWAP=y # CONFIG_MEMCG_SWAP_ENABLED is not set # CONFIG_BLK_CGROUP is not set # CONFIG_CGROUP_SCHED is not set CONFIG_CGROUP_PIDS=y # CONFIG_CGROUP_FREEZER is not set CONFIG_CGROUP_HUGETLB=y # CONFIG_CPUSETS is not set # CONFIG_CGROUP_DEVICE is not set CONFIG_CGROUP_CPUACCT=y # CONFIG_CGROUP_PERF is not set CONFIG_CGROUP_BPF=y # CONFIG_CGROUP_DEBUG is not set # CONFIG_CHECKPOINT_RESTORE is not set CONFIG_NAMESPACES=y CONFIG_UTS_NS=y CONFIG_IPC_NS=y CONFIG_USER_NS=y CONFIG_PID_NS=y CONFIG_NET_NS=y # CONFIG_SCHED_AUTOGROUP is not set # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y # CONFIG_BLK_DEV_INITRD is not set CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y CONFIG_ANON_INODES=y CONFIG_HAVE_UID16=y CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_HAVE_PCSPKR_PLATFORM=y CONFIG_BPF=y CONFIG_EXPERT=y # CONFIG_UID16 is not set CONFIG_MULTIUSER=y # CONFIG_SGETMASK_SYSCALL is not set # CONFIG_SYSFS_SYSCALL is not
CPU Hotplugging disabled, still cpuhp/%d threads running in my 32-bit system
Hello guys. I disabled CPU hotplugging in my .config: still I can see what follows in the process list. 11 ?S 0:00 [cpuhp/0] 12 ?S 0:00 [cpuhp/1] And from what I can see in kernel/cpu.c:574, this is related to CPU hotplugging. Is this normal? And, out of curiosity, why? Running current branch (git) kernel, commit 2cfe8f8290bd28cf1ee67db914a6e76cf8e6437b . Thank you all guys, for your replies and everything, in advance. Enrico My .config: # # Automatically generated file; DO NOT EDIT. # Linux/x86 4.10.0-rc3 Kernel Configuration # # CONFIG_64BIT is not set CONFIG_X86_32=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_OUTPUT_FORMAT="elf32-i386" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_MMU=y CONFIG_ARCH_MMAP_RND_BITS_MIN=8 CONFIG_ARCH_MMAP_RND_BITS_MAX=16 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_X86_32_SMP=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_DEBUG_RODATA=y CONFIG_PGTABLE_LEVELS=2 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_EXTABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION="ho" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y # CONFIG_KERNEL_GZIP is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_LZMA is not set CONFIG_KERNEL_XZ=y # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set CONFIG_DEFAULT_HOSTNAME="(gato-saldo)" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_FHANDLE=y # CONFIG_USELIB is not set # CONFIG_AUDIT is not set CONFIG_HAVE_ARCH_AUDITSYSCALL=y # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y # CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_GENERIC_CMOS_UPDATE=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_IRQ_TIME_ACCOUNTING is not set CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y # CONFIG_TASK_XACCT is not set # # RCU Subsystem # CONFIG_TREE_RCU=y # CONFIG_RCU_EXPERT is not set CONFIG_SRCU=y # CONFIG_TASKS_RCU is not set CONFIG_RCU_STALL_COMMON=y CONFIG_TREE_RCU_TRACE=y # CONFIG_RCU_EXPEDITE_BOOT is not set CONFIG_BUILD_BIN2C=y CONFIG_IKCONFIG=m CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 CONFIG_NMI_LOG_BUF_SHIFT=13 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_CGROUPS=y CONFIG_PAGE_COUNTER=y CONFIG_MEMCG=y CONFIG_MEMCG_SWAP=y # CONFIG_MEMCG_SWAP_ENABLED is not set # CONFIG_BLK_CGROUP is not set # CONFIG_CGROUP_SCHED is not set CONFIG_CGROUP_PIDS=y # CONFIG_CGROUP_FREEZER is not set CONFIG_CGROUP_HUGETLB=y # CONFIG_CPUSETS is not set # CONFIG_CGROUP_DEVICE is not set CONFIG_CGROUP_CPUACCT=y # CONFIG_CGROUP_PERF is not set CONFIG_CGROUP_BPF=y # CONFIG_CGROUP_DEBUG is not set # CONFIG_CHECKPOINT_RESTORE is not set CONFIG_NAMESPACES=y CONFIG_UTS_NS=y CONFIG_IPC_NS=y CONFIG_USER_NS=y CONFIG_PID_NS=y CONFIG_NET_NS=y # CONFIG_SCHED_AUTOGROUP is not set # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y # CONFIG_BLK_DEV_INITRD is not set CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y CONFIG_ANON_INODES=y CONFIG_HAVE_UID16=y CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_HAVE_PCSPKR_PLATFORM=y CONFIG_BPF=y CONFIG_EXPERT=y # CONFIG_UID16 is not set CONFIG_MULTIUSER=y # CONFIG_SGETMASK_SYSCALL is not set # CONFIG_SYSFS_SYSCALL is not
Re: INFO: rcu_sched self-detected stall on CPU
Here is a new trace in the meanwhile: reporting it in case it proves useful. Thank you very much for your help and patience. Enrico [34839.019680] INFO: rcu_sched self-detected stall on CPU [34839.019694] INFO: rcu_sched detected stalls on CPUs/tasks: [34839.019711] 0-...: (1 GPs behind) idle=3d7/1/0 softirq=5887188/5887188 fqs=0 [34839.019713] [34839.019725] 0-...: (1 GPs behind) idle=3d7/1/0 softirq=5887188/5887188 fqs=0 [34839.019727] [34839.019733] (t=39875 jiffies g=3086597 c=3086596 q=1) [34839.019744] rcu_sched kthread starved for 39875 jiffies! g3086597 c3086596 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1 [34839.019751] (detected by 1, t=39875 jiffies, g=3086597, c=3086596, q=1) [34839.019755] Task dump for CPU 0: [34839.019758] rcu_sched S0 7 2 0x [34839.019768] swapper/0 R running task [34839.019774] Call Trace: [34839.019779] 0 0 0 0x0008 [34839.019783] Call Trace: [34839.019808] ? cpuidle_enter_state+0x16c/0x350 [34839.019818] ? __schedule+0x155/0x650 [34839.019831] ? _raw_spin_lock_irqsave+0x14/0x40 [34839.019839] ? cpuidle_enter+0x14/0x20 [34839.019850] ? call_cpuidle+0x21/0x40 [34839.019857] schedule+0x2e/0x70 [34839.019866] ? do_idle+0xd3/0x1b0 [34839.019875] schedule_timeout+0x18f/0x350 [34839.019885] ? cpu_startup_entry+0x65/0x70 [34839.019894] ? del_timer_sync+0x60/0x60 [34839.019904] ? rest_init+0x62/0x70 [34839.019914] rcu_gp_kthread+0x575/0xce0 [34839.019927] ? start_kernel+0x32c/0x342 [34839.019935] ? force_qs_rnp+0x170/0x170 [34839.019946] kthread+0xd6/0x110 [34839.019954] ? i386_start_kernel+0x90/0x94 [34839.019963] ? startup_32_smp+0x16b/0x16d [34839.019971] ? force_qs_rnp+0x170/0x170 [34839.019981] ? kthread_create_on_node+0x30/0x30 [34839.019991] rcu_sched kthread starved for 39875 jiffies! g3086597 c3086596 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1 [34839.019995] rcu_sched S [34839.020004] ret_from_fork+0x19/0x24 [34839.020011] 0 7 2 0x [34839.020015] Call Trace: [34839.020029] ? __schedule+0x155/0x650 [34839.020032] Task dump for CPU 0: [34839.020036] swapper/0 R [34839.020046] ? _raw_spin_lock_irqsave+0x14/0x40 [34839.020049] running task [34839.020057] schedule+0x2e/0x70 [34839.020063] 0 0 0 0x0008 [34839.020071] schedule_timeout+0x18f/0x350 [34839.020075] Call Trace: [34839.020083] ? del_timer_sync+0x60/0x60 [34839.020096] rcu_gp_kthread+0x575/0xce0 [34839.020098] [34839.020109] sched_show_task+0xf3/0x160 [34839.020117] ? force_qs_rnp+0x170/0x170 [34839.020126] kthread+0xd6/0x110 [34839.020133] dump_cpu_task+0x37/0x40 [34839.020143] ? force_qs_rnp+0x170/0x170 [34839.020153] rcu_dump_cpu_stacks+0x79/0x95 [34839.020164] ? kthread_create_on_node+0x30/0x30 [34839.020172] rcu_check_callbacks+0x621/0x770 [34839.020184] ret_from_fork+0x19/0x24 [34839.020191] ? ttwu_do_activate+0x5f/0x70 [34839.020203] update_process_times+0x28/0x50 [34839.020215] tick_sched_handle.isra.11+0x2f/0x40 [34839.020225] tick_sched_timer+0x3b/0x80 [34839.020236] __hrtimer_run_queues+0xdb/0x2b0 [34839.020247] ? tick_sched_do_timer+0x60/0x60 [34839.020258] hrtimer_interrupt+0x8b/0x180 [34839.020269] ? default_send_IPI_mask_logical+0x5f/0x80 [34839.020281] tick_handle_oneshot_broadcast+0x14c/0x190 [34839.020293] timer_interrupt+0x12/0x20 [34839.020304] __handle_irq_event_percpu+0x78/0x190 [34839.020316] ? add_interrupt_randomness+0x144/0x1a0 [34839.020327] ? handle_level_irq+0xf0/0xf0 [34839.020336] handle_irq_event_percpu+0x2c/0x70 [34839.020346] handle_irq_event+0x27/0x40 [34839.020356] handle_edge_irq+0x5d/0x120 [34839.020366] handle_irq+0x9b/0xc0 [34839.020370] [34839.020380] do_IRQ+0x3d/0xc0 [34839.020393] common_interrupt+0x3a/0x40 [34839.020405] EIP: cpuidle_enter_state+0x16c/0x350 [34839.020411] EFLAGS: 00200246 CPU: 0 [34839.020418] EAX: EBX: f9c80a40 ECX: 4ebd61d5 EDX: [34839.020425] ESI: 4ebd61d5 EDI: f9c80a50 EBP: d568df2c ESP: d568defc [34839.020433] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 [34839.020449] cpuidle_enter+0x14/0x20 [34839.020459] call_cpuidle+0x21/0x40 [34839.020468] do_idle+0xd3/0x1b0 [34839.020478] cpu_startup_entry+0x65/0x70 [34839.020488] rest_init+0x62/0x70 [34839.020501] start_kernel+0x32c/0x342 [34839.020511] i386_start_kernel+0x90/0x94 [34839.020521] startup_32_smp+0x16b/0x16d [37701.023799] INFO: rcu_sched self-detected stall on CPU [37701.023830] 0-...: (2 GPs behind) idle=e63/1/0 softirq=5891997/5891997 fqs=0 [37701.023833] INFO: rcu_sched detected stalls on CPUs/tasks: [37701.023837] (t=58299 jiffies g=3092717 c=3092716 q=0) [37701.023854] 0-...: (2 GPs behind) idle=e63/1/0 softirq=5891997/5891997 fqs=0 [37701.023857] [37701.023867] rcu_sched kthread starved for 58299 jiffies! g3092717 c3092716 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1 [37701.023875] (detected by 1, t=58299 jiffies, g=3092717, c=3092716, q=0) [37701.023878] rcu_sched S0 7 2 0x
Re: INFO: rcu_sched self-detected stall on CPU
Here is a new trace in the meanwhile: reporting it in case it proves useful. Thank you very much for your help and patience. Enrico [34839.019680] INFO: rcu_sched self-detected stall on CPU [34839.019694] INFO: rcu_sched detected stalls on CPUs/tasks: [34839.019711] 0-...: (1 GPs behind) idle=3d7/1/0 softirq=5887188/5887188 fqs=0 [34839.019713] [34839.019725] 0-...: (1 GPs behind) idle=3d7/1/0 softirq=5887188/5887188 fqs=0 [34839.019727] [34839.019733] (t=39875 jiffies g=3086597 c=3086596 q=1) [34839.019744] rcu_sched kthread starved for 39875 jiffies! g3086597 c3086596 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1 [34839.019751] (detected by 1, t=39875 jiffies, g=3086597, c=3086596, q=1) [34839.019755] Task dump for CPU 0: [34839.019758] rcu_sched S0 7 2 0x [34839.019768] swapper/0 R running task [34839.019774] Call Trace: [34839.019779] 0 0 0 0x0008 [34839.019783] Call Trace: [34839.019808] ? cpuidle_enter_state+0x16c/0x350 [34839.019818] ? __schedule+0x155/0x650 [34839.019831] ? _raw_spin_lock_irqsave+0x14/0x40 [34839.019839] ? cpuidle_enter+0x14/0x20 [34839.019850] ? call_cpuidle+0x21/0x40 [34839.019857] schedule+0x2e/0x70 [34839.019866] ? do_idle+0xd3/0x1b0 [34839.019875] schedule_timeout+0x18f/0x350 [34839.019885] ? cpu_startup_entry+0x65/0x70 [34839.019894] ? del_timer_sync+0x60/0x60 [34839.019904] ? rest_init+0x62/0x70 [34839.019914] rcu_gp_kthread+0x575/0xce0 [34839.019927] ? start_kernel+0x32c/0x342 [34839.019935] ? force_qs_rnp+0x170/0x170 [34839.019946] kthread+0xd6/0x110 [34839.019954] ? i386_start_kernel+0x90/0x94 [34839.019963] ? startup_32_smp+0x16b/0x16d [34839.019971] ? force_qs_rnp+0x170/0x170 [34839.019981] ? kthread_create_on_node+0x30/0x30 [34839.019991] rcu_sched kthread starved for 39875 jiffies! g3086597 c3086596 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1 [34839.019995] rcu_sched S [34839.020004] ret_from_fork+0x19/0x24 [34839.020011] 0 7 2 0x [34839.020015] Call Trace: [34839.020029] ? __schedule+0x155/0x650 [34839.020032] Task dump for CPU 0: [34839.020036] swapper/0 R [34839.020046] ? _raw_spin_lock_irqsave+0x14/0x40 [34839.020049] running task [34839.020057] schedule+0x2e/0x70 [34839.020063] 0 0 0 0x0008 [34839.020071] schedule_timeout+0x18f/0x350 [34839.020075] Call Trace: [34839.020083] ? del_timer_sync+0x60/0x60 [34839.020096] rcu_gp_kthread+0x575/0xce0 [34839.020098] [34839.020109] sched_show_task+0xf3/0x160 [34839.020117] ? force_qs_rnp+0x170/0x170 [34839.020126] kthread+0xd6/0x110 [34839.020133] dump_cpu_task+0x37/0x40 [34839.020143] ? force_qs_rnp+0x170/0x170 [34839.020153] rcu_dump_cpu_stacks+0x79/0x95 [34839.020164] ? kthread_create_on_node+0x30/0x30 [34839.020172] rcu_check_callbacks+0x621/0x770 [34839.020184] ret_from_fork+0x19/0x24 [34839.020191] ? ttwu_do_activate+0x5f/0x70 [34839.020203] update_process_times+0x28/0x50 [34839.020215] tick_sched_handle.isra.11+0x2f/0x40 [34839.020225] tick_sched_timer+0x3b/0x80 [34839.020236] __hrtimer_run_queues+0xdb/0x2b0 [34839.020247] ? tick_sched_do_timer+0x60/0x60 [34839.020258] hrtimer_interrupt+0x8b/0x180 [34839.020269] ? default_send_IPI_mask_logical+0x5f/0x80 [34839.020281] tick_handle_oneshot_broadcast+0x14c/0x190 [34839.020293] timer_interrupt+0x12/0x20 [34839.020304] __handle_irq_event_percpu+0x78/0x190 [34839.020316] ? add_interrupt_randomness+0x144/0x1a0 [34839.020327] ? handle_level_irq+0xf0/0xf0 [34839.020336] handle_irq_event_percpu+0x2c/0x70 [34839.020346] handle_irq_event+0x27/0x40 [34839.020356] handle_edge_irq+0x5d/0x120 [34839.020366] handle_irq+0x9b/0xc0 [34839.020370] [34839.020380] do_IRQ+0x3d/0xc0 [34839.020393] common_interrupt+0x3a/0x40 [34839.020405] EIP: cpuidle_enter_state+0x16c/0x350 [34839.020411] EFLAGS: 00200246 CPU: 0 [34839.020418] EAX: EBX: f9c80a40 ECX: 4ebd61d5 EDX: [34839.020425] ESI: 4ebd61d5 EDI: f9c80a50 EBP: d568df2c ESP: d568defc [34839.020433] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 [34839.020449] cpuidle_enter+0x14/0x20 [34839.020459] call_cpuidle+0x21/0x40 [34839.020468] do_idle+0xd3/0x1b0 [34839.020478] cpu_startup_entry+0x65/0x70 [34839.020488] rest_init+0x62/0x70 [34839.020501] start_kernel+0x32c/0x342 [34839.020511] i386_start_kernel+0x90/0x94 [34839.020521] startup_32_smp+0x16b/0x16d [37701.023799] INFO: rcu_sched self-detected stall on CPU [37701.023830] 0-...: (2 GPs behind) idle=e63/1/0 softirq=5891997/5891997 fqs=0 [37701.023833] INFO: rcu_sched detected stalls on CPUs/tasks: [37701.023837] (t=58299 jiffies g=3092717 c=3092716 q=0) [37701.023854] 0-...: (2 GPs behind) idle=e63/1/0 softirq=5891997/5891997 fqs=0 [37701.023857] [37701.023867] rcu_sched kthread starved for 58299 jiffies! g3092717 c3092716 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1 [37701.023875] (detected by 1, t=58299 jiffies, g=3092717, c=3092716, q=0) [37701.023878] rcu_sched S0 7 2 0x
Re: INFO: rcu_sched self-detected stall on CPU
Here is my .config: I send it 'cause I wasn't able to determine if I selected the right options. Sorry for this long config: I don't know how to represent those infos more efficiently. I would be very glad if you could send me some hints on how to perform ftracing the right way. From past work, my impression was there are different ways it's better to operate depending on how you'll process thedata and what you're looking for. Sorry for the churn, thank you very much. Enrico # # Automatically generated file; DO NOT EDIT. # Linux/x86 4.10.0-rc2 Kernel Configuration # # CONFIG_64BIT is not set CONFIG_X86_32=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_OUTPUT_FORMAT="elf32-i386" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_MMU=y CONFIG_ARCH_MMAP_RND_BITS_MIN=8 CONFIG_ARCH_MMAP_RND_BITS_MAX=16 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_X86_32_SMP=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_DEBUG_RODATA=y CONFIG_PGTABLE_LEVELS=2 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_EXTABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION="ho" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y # CONFIG_KERNEL_GZIP is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_LZMA is not set CONFIG_KERNEL_XZ=y # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set CONFIG_DEFAULT_HOSTNAME="(gato-saldo)" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_FHANDLE=y # CONFIG_USELIB is not set # CONFIG_AUDIT is not set CONFIG_HAVE_ARCH_AUDITSYSCALL=y # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y # CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_GENERIC_CMOS_UPDATE=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_IRQ_TIME_ACCOUNTING is not set CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y # CONFIG_TASK_XACCT is not set # # RCU Subsystem # CONFIG_TREE_RCU=y # CONFIG_RCU_EXPERT is not set CONFIG_SRCU=y # CONFIG_TASKS_RCU is not set CONFIG_RCU_STALL_COMMON=y CONFIG_TREE_RCU_TRACE=y # CONFIG_RCU_EXPEDITE_BOOT is not set CONFIG_BUILD_BIN2C=y CONFIG_IKCONFIG=m CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 CONFIG_NMI_LOG_BUF_SHIFT=13 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_CGROUPS=y CONFIG_PAGE_COUNTER=y CONFIG_MEMCG=y CONFIG_MEMCG_SWAP=y # CONFIG_MEMCG_SWAP_ENABLED is not set # CONFIG_BLK_CGROUP is not set # CONFIG_CGROUP_SCHED is not set CONFIG_CGROUP_PIDS=y # CONFIG_CGROUP_FREEZER is not set CONFIG_CGROUP_HUGETLB=y # CONFIG_CPUSETS is not set # CONFIG_CGROUP_DEVICE is not set CONFIG_CGROUP_CPUACCT=y # CONFIG_CGROUP_PERF is not set CONFIG_CGROUP_BPF=y # CONFIG_CGROUP_DEBUG is not set # CONFIG_CHECKPOINT_RESTORE is not set CONFIG_NAMESPACES=y CONFIG_UTS_NS=y CONFIG_IPC_NS=y CONFIG_USER_NS=y CONFIG_PID_NS=y CONFIG_NET_NS=y # CONFIG_SCHED_AUTOGROUP is not set # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y # CONFIG_BLK_DEV_INITRD is not set CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y CONFIG_ANON_INODES=y CONFIG_HAVE_UID16=y CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_HAVE_PCSPKR_PLATFORM=y CONFIG_BPF=y CONFIG_EXPERT=y # CONFIG_UID16 is not set CONFIG_MULTIUSER=y # CONFIG_SGETMASK_SYSCALL is not set #
Re: INFO: rcu_sched self-detected stall on CPU
Here is my .config: I send it 'cause I wasn't able to determine if I selected the right options. Sorry for this long config: I don't know how to represent those infos more efficiently. I would be very glad if you could send me some hints on how to perform ftracing the right way. From past work, my impression was there are different ways it's better to operate depending on how you'll process thedata and what you're looking for. Sorry for the churn, thank you very much. Enrico # # Automatically generated file; DO NOT EDIT. # Linux/x86 4.10.0-rc2 Kernel Configuration # # CONFIG_64BIT is not set CONFIG_X86_32=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_OUTPUT_FORMAT="elf32-i386" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_MMU=y CONFIG_ARCH_MMAP_RND_BITS_MIN=8 CONFIG_ARCH_MMAP_RND_BITS_MAX=16 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_X86_32_SMP=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_DEBUG_RODATA=y CONFIG_PGTABLE_LEVELS=2 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_EXTABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION="ho" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y # CONFIG_KERNEL_GZIP is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_LZMA is not set CONFIG_KERNEL_XZ=y # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set CONFIG_DEFAULT_HOSTNAME="(gato-saldo)" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_FHANDLE=y # CONFIG_USELIB is not set # CONFIG_AUDIT is not set CONFIG_HAVE_ARCH_AUDITSYSCALL=y # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y # CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_GENERIC_CMOS_UPDATE=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_IRQ_TIME_ACCOUNTING is not set CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y # CONFIG_TASK_XACCT is not set # # RCU Subsystem # CONFIG_TREE_RCU=y # CONFIG_RCU_EXPERT is not set CONFIG_SRCU=y # CONFIG_TASKS_RCU is not set CONFIG_RCU_STALL_COMMON=y CONFIG_TREE_RCU_TRACE=y # CONFIG_RCU_EXPEDITE_BOOT is not set CONFIG_BUILD_BIN2C=y CONFIG_IKCONFIG=m CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 CONFIG_NMI_LOG_BUF_SHIFT=13 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_CGROUPS=y CONFIG_PAGE_COUNTER=y CONFIG_MEMCG=y CONFIG_MEMCG_SWAP=y # CONFIG_MEMCG_SWAP_ENABLED is not set # CONFIG_BLK_CGROUP is not set # CONFIG_CGROUP_SCHED is not set CONFIG_CGROUP_PIDS=y # CONFIG_CGROUP_FREEZER is not set CONFIG_CGROUP_HUGETLB=y # CONFIG_CPUSETS is not set # CONFIG_CGROUP_DEVICE is not set CONFIG_CGROUP_CPUACCT=y # CONFIG_CGROUP_PERF is not set CONFIG_CGROUP_BPF=y # CONFIG_CGROUP_DEBUG is not set # CONFIG_CHECKPOINT_RESTORE is not set CONFIG_NAMESPACES=y CONFIG_UTS_NS=y CONFIG_IPC_NS=y CONFIG_USER_NS=y CONFIG_PID_NS=y CONFIG_NET_NS=y # CONFIG_SCHED_AUTOGROUP is not set # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y # CONFIG_BLK_DEV_INITRD is not set CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y CONFIG_ANON_INODES=y CONFIG_HAVE_UID16=y CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_HAVE_PCSPKR_PLATFORM=y CONFIG_BPF=y CONFIG_EXPERT=y # CONFIG_UID16 is not set CONFIG_MULTIUSER=y # CONFIG_SGETMASK_SYSCALL is not set #
Re: INFO: rcu_sched self-detected stall on CPU
Thank you very much guys. Can you giveme some guidances on how to actually use ftrace? I'll recompile the kernel as needed and read the ftrace docs, but I would like to be sure to be able to produce the needed data. Thank you very much, Enrico
Re: INFO: rcu_sched self-detected stall on CPU
Thank you very much guys. Can you giveme some guidances on how to actually use ftrace? I'll recompile the kernel as needed and read the ftrace docs, but I would like to be sure to be able to produce the needed data. Thank you very much, Enrico
Re: [ftrace] kernel panics during my attempt to use ftrace
Thank you guys very much for your kind answers. I can not prove it actually: but I think it's right. It seems upgrading binutils could have solved the problem. I am sorry for my impreciseness: but in the actual Ubuntu kernel version, 4.4.0-31** ?, the problem seems fixed. I can enable kernel tracing without hitting a panic. Thank you very much for your help and replies.
Re: [ftrace] kernel panics during my attempt to use ftrace
Thank you guys very much for your kind answers. I can not prove it actually: but I think it's right. It seems upgrading binutils could have solved the problem. I am sorry for my impreciseness: but in the actual Ubuntu kernel version, 4.4.0-31** ?, the problem seems fixed. I can enable kernel tracing without hitting a panic. Thank you very much for your help and replies.
Re: [ftrace] kernel panics during my attempt to use ftrace
Thank you very much for the report. I'll let you know guys, once I am able to get to work on this again , at least I'll try. Thank you very much anyway.
Re: [ftrace] kernel panics during my attempt to use ftrace
Thank you very much for the report. I'll let you know guys, once I am able to get to work on this again , at least I'll try. Thank you very much anyway.
Re: [ftrace] kernel panics during my attempt to use ftrace
Hi Steven. Thank you for your very very kind response. I can build a stock kernel (I usually did for my real hw): and I don't see problems on this. The problem is the bitness. My only KVM-enabled machine, as far as I can tell, has a 32-bit CPU. So This would be a different problem. I'll let you know when I can continue: right now I am a little bit in trouble with my exams: but I hope I will be able to eventually cme back and test. Below my cpuinfo just for the record. Thank you very much, Enrico processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU Z520 @ 1.33GHz stepping: 2 microcode : 0x211 cpu MHz : 1333.000 cache size : 512 KB physical id : 0 siblings: 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug: no f00f_bug: no coma_bug: no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts aperfmperf eagerfpu pni dtes64 monitor ds_cpl vmx est tm2 ssse3 xtpr pdcm movbe lahf_lm tpr_shadow vnmi flexpriority dtherm bugs: bogomips: 2662.89 clflush size: 64 cache_alignment : 64 address sizes : 32 bits physical, 32 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU Z520 @ 1.33GHz stepping: 2 microcode : 0x211 cpu MHz : 800.000 cache size : 512 KB physical id : 0 siblings: 2 core id : 0 cpu cores : 1 apicid : 1 initial apicid : 1 fdiv_bug: no f00f_bug: no coma_bug: no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts aperfmperf eagerfpu pni dtes64 monitor ds_cpl vmx est tm2 ssse3 xtpr pdcm movbe lahf_lm tpr_shadow vnmi flexpriority dtherm bugs: bogomips: 2662.42 clflush size: 64 cache_alignment : 64 address sizes : 32 bits physical, 32 bits virtual power management:
Re: [ftrace] kernel panics during my attempt to use ftrace
Hi Steven. Thank you for your very very kind response. I can build a stock kernel (I usually did for my real hw): and I don't see problems on this. The problem is the bitness. My only KVM-enabled machine, as far as I can tell, has a 32-bit CPU. So This would be a different problem. I'll let you know when I can continue: right now I am a little bit in trouble with my exams: but I hope I will be able to eventually cme back and test. Below my cpuinfo just for the record. Thank you very much, Enrico processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU Z520 @ 1.33GHz stepping: 2 microcode : 0x211 cpu MHz : 1333.000 cache size : 512 KB physical id : 0 siblings: 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug: no f00f_bug: no coma_bug: no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts aperfmperf eagerfpu pni dtes64 monitor ds_cpl vmx est tm2 ssse3 xtpr pdcm movbe lahf_lm tpr_shadow vnmi flexpriority dtherm bugs: bogomips: 2662.89 clflush size: 64 cache_alignment : 64 address sizes : 32 bits physical, 32 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU Z520 @ 1.33GHz stepping: 2 microcode : 0x211 cpu MHz : 800.000 cache size : 512 KB physical id : 0 siblings: 2 core id : 0 cpu cores : 1 apicid : 1 initial apicid : 1 fdiv_bug: no f00f_bug: no coma_bug: no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts aperfmperf eagerfpu pni dtes64 monitor ds_cpl vmx est tm2 ssse3 xtpr pdcm movbe lahf_lm tpr_shadow vnmi flexpriority dtherm bugs: bogomips: 2662.42 clflush size: 64 cache_alignment : 64 address sizes : 32 bits physical, 32 bits virtual power management:
[ftrace] kernel panics during my attempt to use ftrace
Hello guys. First of all - thank you for your great work in ftrace, and in general in the Linux tracing infrastructure. I am a newbie: so I am not able to use it at it's full power, still I find it's capabilities impressive. I am asking for help, since I am encountering some problems in using ftrace. I am trying to come up with a solution to trace a specific workload (a program): to understand what are the functions the kernel spends most of his time in. To do so, I inspired myself to some code I found around (I can mention it if needed). I took free inspiration: so my editing may be very very wrong. When I run this script, the kernel panics. the output is below. the kernel is Ubuntu 16.04 stock, running in a qemu virtual machine (using kvm). Any help would be greatly apreciated. Thank you very much guys. Fort any needed infos, contact me. Enrico Script: #!/bin/sh if [ `whoami` != root ] then echo you need to run this script as root exit 1 fi tdir=/sys/kernel/debug/tracing start() { # echo 5 > $tdir/buffer_size_kb echo function_graph > $tdir/current_tracer echo 1000 >$tdir/tracing_thresh echo >$tdir/trace echo 1 >$tdir/tracing_on # ** this is wrong, interface changed? } stop() { echo >set_event echo 0 >$tdir/tracing_on output=trace`date +%y-%m-%d-%H-%M-%S`.txt echo funcgraph-abstime >$tdir/trace_options echo funcgraph-proc >$tdir/trace_options cat $tdir/trace > $output echo trace written to $output } COMMAND="$1" case $COMMAND in start|stop) $COMMAND ;; *) echo "usage: $0 [start|stop]" ;; esac Kernel panic output: [ 825.336708] BUG: unable to handle kernel paging request at 55501e06 [ 825.340572] IP: [] ftrace_regs_caller+0xa/0x35 [ 825.340572] *pdpt = 1ef4c001 *pde = [ 825.340572] Oops: [#1] SMP [ 825.340572] Modules linked in: isofs ppdev joydev serio_raw parport_pc parpor t ib_iser rdma_cm iw_cm ib_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tc p libiscsi scsi_transport_iscsi autofs4 btrfs raid10 raid456 async_raid6_recov a sync_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multi path linear psmouse e1000 floppy [ 825.340572] CPU: 0 PID: 7 Comm: rcu_sched Not tainted 4.4.0-24-generic #43-Ub untu [ 825.340572] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.2 -20160422_131301-anatol 04/01/2014 [ 825.340572] task: de8f3480 ti: de988000 task.ti: de988000 [ 825.340572] EIP: 0060:[] EFLAGS: 00010202 CPU: 0 [ 825.340572] EIP is at ftrace_regs_caller+0xa/0x35 [ 825.340572] EAX: de989e4e EBX: c10db072 ECX: EDX: 0268 [ 825.340572] ESI: de8f3480 EDI: dee08800 EBP: de989f10 ESP: de989ec4 [ 825.340572] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 [ 825.340572] CR0: 8005003b CR2: 55501e06 CR3: 1e073e20 CR4: 06e0 [ 825.340572] Stack: [ 825.340572] c113f017 de8f3480 d4d1dc00 de989f0c c17a5b75 de9d4ec0 de989f60 d e989f60 [ 825.340572] c17a60e8 edf05431 0268 f2ee631c 0268 8 aced3dc [ 825.340572] c1ae0490 c1ae0300 de989f60 c17aaa46 dffbbdc0 0 000 [ 825.340572] Call Trace: [ 825.340572] [] ? ftrace_return_to_handler+0x97/0x170 [ 825.340572] [] ? __schedule+0x305/0x790 [ 825.340572] [] ? yield_to+0x68/0x170 [ 825.340572] [] return_to_handler+0x9/0xf [ 825.340572] [] ? wake_atomic_t_function+0x70/0x70 [ 825.340572] [] ? force_qs_rnp+0x140/0x140 [ 825.340572] [] kthread+0xa6/0xc0 [ 825.340572] [] ret_from_kernel_thread+0x21/0x38 [ 825.340572] [] ? kthread_create_on_node+0x170/0x170 [ 825.340572] Code: 6a 00 8b 44 24 10 8b 55 04 8b 0d 94 14 b7 c1 83 e8 05 e8 08 00 00 00 83 c4 04 5a 59 58 e9 63 00 00 00 ff 74 24 04 6a 00 0f a8 0f 06 1e 50 55 57 56 52 51 53 8b 44 24 34 89 44 24 38 c7 44 24 [ 825.340572] EIP: [] ftrace_regs_caller+0xa/0x35 SS:ESP 0068:de989ec 4 [ 825.340572] CR2: 55501e06 [ 825.340572] ---[ end trace 4f291f60e8d43d37 ]--- [ 825.996200] invalid opcode: [#2] SMP [ 826.50] Modules linked in: isofs ppdev joydev serio_raw parport_pc parpor t ib_iser rdma_cm iw_cm ib_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tc p libiscsi scsi_transport_iscsi autofs4 btrfs raid10 raid456 async_raid6_recov a sync_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multi path linear psmouse e1000 floppy [ 826.50] CPU: 0 PID: 1044 Comm: iscsid Tainted: G D 4.4.0-24- generic #43-Ubuntu [ 826.50] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.2 -20160422_131301-anatol 04/01/2014 [ 826.50] task: d4679180 ti: dee54000 task.ti: dee54000 [ 826.50] EIP: 0060:[] EFLAGS: 00010217 CPU: 0 [ 826.50] EIP is at ftrace_stub+0x0/0x2 [ 826.50] EAX: dee55adc EBX: c17a8d92 ECX: EDX: 0269 [ 826.50] ESI: d4679180 EDI: de0e9800 EBP: dee55b08 ESP: dee55abc [ 826.50] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 [ 826.50] CR0: 8005003b CR2: b7362010 CR3:
[ftrace] kernel panics during my attempt to use ftrace
Hello guys. First of all - thank you for your great work in ftrace, and in general in the Linux tracing infrastructure. I am a newbie: so I am not able to use it at it's full power, still I find it's capabilities impressive. I am asking for help, since I am encountering some problems in using ftrace. I am trying to come up with a solution to trace a specific workload (a program): to understand what are the functions the kernel spends most of his time in. To do so, I inspired myself to some code I found around (I can mention it if needed). I took free inspiration: so my editing may be very very wrong. When I run this script, the kernel panics. the output is below. the kernel is Ubuntu 16.04 stock, running in a qemu virtual machine (using kvm). Any help would be greatly apreciated. Thank you very much guys. Fort any needed infos, contact me. Enrico Script: #!/bin/sh if [ `whoami` != root ] then echo you need to run this script as root exit 1 fi tdir=/sys/kernel/debug/tracing start() { # echo 5 > $tdir/buffer_size_kb echo function_graph > $tdir/current_tracer echo 1000 >$tdir/tracing_thresh echo >$tdir/trace echo 1 >$tdir/tracing_on # ** this is wrong, interface changed? } stop() { echo >set_event echo 0 >$tdir/tracing_on output=trace`date +%y-%m-%d-%H-%M-%S`.txt echo funcgraph-abstime >$tdir/trace_options echo funcgraph-proc >$tdir/trace_options cat $tdir/trace > $output echo trace written to $output } COMMAND="$1" case $COMMAND in start|stop) $COMMAND ;; *) echo "usage: $0 [start|stop]" ;; esac Kernel panic output: [ 825.336708] BUG: unable to handle kernel paging request at 55501e06 [ 825.340572] IP: [] ftrace_regs_caller+0xa/0x35 [ 825.340572] *pdpt = 1ef4c001 *pde = [ 825.340572] Oops: [#1] SMP [ 825.340572] Modules linked in: isofs ppdev joydev serio_raw parport_pc parpor t ib_iser rdma_cm iw_cm ib_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tc p libiscsi scsi_transport_iscsi autofs4 btrfs raid10 raid456 async_raid6_recov a sync_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multi path linear psmouse e1000 floppy [ 825.340572] CPU: 0 PID: 7 Comm: rcu_sched Not tainted 4.4.0-24-generic #43-Ub untu [ 825.340572] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.2 -20160422_131301-anatol 04/01/2014 [ 825.340572] task: de8f3480 ti: de988000 task.ti: de988000 [ 825.340572] EIP: 0060:[] EFLAGS: 00010202 CPU: 0 [ 825.340572] EIP is at ftrace_regs_caller+0xa/0x35 [ 825.340572] EAX: de989e4e EBX: c10db072 ECX: EDX: 0268 [ 825.340572] ESI: de8f3480 EDI: dee08800 EBP: de989f10 ESP: de989ec4 [ 825.340572] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 [ 825.340572] CR0: 8005003b CR2: 55501e06 CR3: 1e073e20 CR4: 06e0 [ 825.340572] Stack: [ 825.340572] c113f017 de8f3480 d4d1dc00 de989f0c c17a5b75 de9d4ec0 de989f60 d e989f60 [ 825.340572] c17a60e8 edf05431 0268 f2ee631c 0268 8 aced3dc [ 825.340572] c1ae0490 c1ae0300 de989f60 c17aaa46 dffbbdc0 0 000 [ 825.340572] Call Trace: [ 825.340572] [] ? ftrace_return_to_handler+0x97/0x170 [ 825.340572] [] ? __schedule+0x305/0x790 [ 825.340572] [] ? yield_to+0x68/0x170 [ 825.340572] [] return_to_handler+0x9/0xf [ 825.340572] [] ? wake_atomic_t_function+0x70/0x70 [ 825.340572] [] ? force_qs_rnp+0x140/0x140 [ 825.340572] [] kthread+0xa6/0xc0 [ 825.340572] [] ret_from_kernel_thread+0x21/0x38 [ 825.340572] [] ? kthread_create_on_node+0x170/0x170 [ 825.340572] Code: 6a 00 8b 44 24 10 8b 55 04 8b 0d 94 14 b7 c1 83 e8 05 e8 08 00 00 00 83 c4 04 5a 59 58 e9 63 00 00 00 ff 74 24 04 6a 00 0f a8 0f 06 1e 50 55 57 56 52 51 53 8b 44 24 34 89 44 24 38 c7 44 24 [ 825.340572] EIP: [] ftrace_regs_caller+0xa/0x35 SS:ESP 0068:de989ec 4 [ 825.340572] CR2: 55501e06 [ 825.340572] ---[ end trace 4f291f60e8d43d37 ]--- [ 825.996200] invalid opcode: [#2] SMP [ 826.50] Modules linked in: isofs ppdev joydev serio_raw parport_pc parpor t ib_iser rdma_cm iw_cm ib_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tc p libiscsi scsi_transport_iscsi autofs4 btrfs raid10 raid456 async_raid6_recov a sync_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multi path linear psmouse e1000 floppy [ 826.50] CPU: 0 PID: 1044 Comm: iscsid Tainted: G D 4.4.0-24- generic #43-Ubuntu [ 826.50] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.2 -20160422_131301-anatol 04/01/2014 [ 826.50] task: d4679180 ti: dee54000 task.ti: dee54000 [ 826.50] EIP: 0060:[] EFLAGS: 00010217 CPU: 0 [ 826.50] EIP is at ftrace_stub+0x0/0x2 [ 826.50] EAX: dee55adc EBX: c17a8d92 ECX: EDX: 0269 [ 826.50] ESI: d4679180 EDI: de0e9800 EBP: dee55b08 ESP: dee55abc [ 826.50] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 [ 826.50] CR0: 8005003b CR2: b7362010 CR3:
arch/x86/kvm/x86.c:6207:13: warning: ■process_smi_save_seg_64■ defined but not used [-Wunused-function]
Hello guys. Just to tell you, I report this warning, while compiling the kernel from git repository ( updated at commit 14a6f1989dae9445d4532941bdd6bbad84f4c8da ): CC arch/x86/kernel/setup.o arch/x86/kvm/x86.c:6207:13: warning: ■process_smi_save_seg_64■ defined but not used [-Wunused-function] tatic void process_smi_save_seg_64(struct kvm_vcpu *vcpu, char *buf, int n) ^ Using gcc version: gcc (GCC) 5.1.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. As version: GNU assembler (GNU Binutils) 2.25.0 Copyright (C) 2014 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty. This assembler was configured for a target of `i686-pc-linux-gnu'. On a 32-bit system (see attached .config). Thank you, Enrico # # Automatically generated file; DO NOT EDIT. # Linux/x86 4.1.0 Kernel Configuration # # CONFIG_64BIT is not set CONFIG_X86_32=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_PERF_EVENTS_INTEL_UNCORE=y CONFIG_OUTPUT_FORMAT="elf32-i386" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_MMU=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_X86_32_SMP=y CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-ecx -fcall-saved-edx" CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_PGTABLE_LEVELS=2 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_EXTABLE_SORT=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION="hc" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y # CONFIG_KERNEL_GZIP is not set # CONFIG_KERNEL_BZIP2 is not set CONFIG_KERNEL_LZMA=y # CONFIG_KERNEL_XZ is not set # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set CONFIG_DEFAULT_HOSTNAME="(EEE1101HGo)" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_FHANDLE=y # CONFIG_USELIB is not set # CONFIG_AUDIT is not set CONFIG_HAVE_ARCH_AUDITSYSCALL=y # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y # CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_GENERIC_CMOS_UPDATE=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_IRQ_TIME_ACCOUNTING is not set CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y # CONFIG_TASK_XACCT is not set # # RCU Subsystem # CONFIG_TREE_RCU=y # CONFIG_RCU_EXPERT is not set CONFIG_SRCU=y # CONFIG_TASKS_RCU is not set CONFIG_RCU_STALL_COMMON=y # CONFIG_TREE_RCU_TRACE is not set # CONFIG_RCU_NOCB_CPU is not set # CONFIG_RCU_EXPEDITE_BOOT is not set CONFIG_BUILD_BIN2C=y CONFIG_IKCONFIG=m CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y CONFIG_CGROUPS=y # CONFIG_CGROUP_DEBUG is not set CONFIG_CGROUP_FREEZER=y # CONFIG_CGROUP_DEVICE is not set # CONFIG_CPUSETS is not set CONFIG_CGROUP_CPUACCT=y CONFIG_PAGE_COUNTER=y CONFIG_MEMCG=y # CONFIG_MEMCG_SWAP is not set # CONFIG_MEMCG_KMEM is not set # CONFIG_CGROUP_PERF is not set # CONFIG_CGROUP_SCHED is not set # CONFIG_BLK_CGROUP is not set # CONFIG_CHECKPOINT_RESTORE is not set # CONFIG_NAMESPACES is not set # CONFIG_SCHED_AUTOGROUP is not set # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y # CONFIG_BLK_DEV_INITRD is not set
arch/x86/kvm/x86.c:6207:13: warning: ■process_smi_save_seg_64■ defined but not used [-Wunused-function]
Hello guys. Just to tell you, I report this warning, while compiling the kernel from git repository ( updated at commit 14a6f1989dae9445d4532941bdd6bbad84f4c8da ): CC arch/x86/kernel/setup.o arch/x86/kvm/x86.c:6207:13: warning: ■process_smi_save_seg_64■ defined but not used [-Wunused-function] tatic void process_smi_save_seg_64(struct kvm_vcpu *vcpu, char *buf, int n) ^ Using gcc version: gcc (GCC) 5.1.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. As version: GNU assembler (GNU Binutils) 2.25.0 Copyright (C) 2014 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty. This assembler was configured for a target of `i686-pc-linux-gnu'. On a 32-bit system (see attached .config). Thank you, Enrico # # Automatically generated file; DO NOT EDIT. # Linux/x86 4.1.0 Kernel Configuration # # CONFIG_64BIT is not set CONFIG_X86_32=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_PERF_EVENTS_INTEL_UNCORE=y CONFIG_OUTPUT_FORMAT=elf32-i386 CONFIG_ARCH_DEFCONFIG=arch/x86/configs/i386_defconfig CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_MMU=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_X86_32_SMP=y CONFIG_ARCH_HWEIGHT_CFLAGS=-fcall-saved-ecx -fcall-saved-edx CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_PGTABLE_LEVELS=2 CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_EXTABLE_SORT=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE= # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION=hc # CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y # CONFIG_KERNEL_GZIP is not set # CONFIG_KERNEL_BZIP2 is not set CONFIG_KERNEL_LZMA=y # CONFIG_KERNEL_XZ is not set # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set CONFIG_DEFAULT_HOSTNAME=(EEE1101HGo) CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_FHANDLE=y # CONFIG_USELIB is not set # CONFIG_AUDIT is not set CONFIG_HAVE_ARCH_AUDITSYSCALL=y # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y # CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_GENERIC_CMOS_UPDATE=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_IRQ_TIME_ACCOUNTING is not set CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y # CONFIG_TASK_XACCT is not set # # RCU Subsystem # CONFIG_TREE_RCU=y # CONFIG_RCU_EXPERT is not set CONFIG_SRCU=y # CONFIG_TASKS_RCU is not set CONFIG_RCU_STALL_COMMON=y # CONFIG_TREE_RCU_TRACE is not set # CONFIG_RCU_NOCB_CPU is not set # CONFIG_RCU_EXPEDITE_BOOT is not set CONFIG_BUILD_BIN2C=y CONFIG_IKCONFIG=m CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y CONFIG_CGROUPS=y # CONFIG_CGROUP_DEBUG is not set CONFIG_CGROUP_FREEZER=y # CONFIG_CGROUP_DEVICE is not set # CONFIG_CPUSETS is not set CONFIG_CGROUP_CPUACCT=y CONFIG_PAGE_COUNTER=y CONFIG_MEMCG=y # CONFIG_MEMCG_SWAP is not set # CONFIG_MEMCG_KMEM is not set # CONFIG_CGROUP_PERF is not set # CONFIG_CGROUP_SCHED is not set # CONFIG_BLK_CGROUP is not set # CONFIG_CHECKPOINT_RESTORE is not set # CONFIG_NAMESPACES is not set # CONFIG_SCHED_AUTOGROUP is not set # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y # CONFIG_BLK_DEV_INITRD is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y
Re: X86 GIT GCC 5 compilation warning
Hi guys. I am running the new kernel - and all is well. Thank you. Enrico Mioso -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: X86 GIT GCC 5 compilation warning
Hi Boris. thank you for the tested tag. I can confirm you that your patch fixed the warning. >From my kernel compilation output: ... UPD kernel/config_data.h CC [M] kernel/configs.o LD arch/x86/kernel/cpu/built-in.o AS arch/x86/kernel/head_32.o LD arch/x86/kernel/built-in.o LD arch/x86/built-in.o CC [M] sound/hda/hdac_device.o I didn't boot-test it yet. On this system it will take a while to compile even due to high load conditions. When compilation it's over I'll kexec to this new kernel and let you know if there are any problems. Thank you again, Enrico Mioso On Tue, 16 Jun 2015, Borislav Petkov wrote: ==Date: Tue, 16 Jun 2015 15:58:01 ==From: Borislav Petkov ==To: Enrico Mioso ==Cc: Michael Matz , linux-kernel@vger.kernel.org, ==x86-ml ==Subject: Re: X86 GIT GCC 5 compilation warning == ==On Tue, Jun 16, 2015 at 02:47:02PM +0200, Michael Matz wrote: ==> Yeah, building like so on i686 will produce an assembler that warns on ==> "1<<32". == ==Enrico, try this. == ==--- ==From: Borislav Petkov ==Date: Tue, 16 Jun 2015 15:43:27 +0200 ==Subject: [PATCH] x86/head_32: Fix overflow warning with 32-bit binutils == ==When building the kernel with 32-bit binutils built with support only ==for the i386 target, we get the following warning: == == arch/x86/kernel/head_32.S:66: Warning: shift count out of range (32 is not between 0 and 31) == ==The problem is that in that case, binutils' internal type representation ==is 32-bit wide and the shift range overflows. == ==In order to fix this, manipulate the shift expression which creates the ==4GiB constant to not overflow the shift count. == ==Reported-by: Enrico Mioso ==Suggested-by: Michael Matz ==Signed-off-by: Borislav Petkov ==--- == arch/x86/kernel/head_32.S | 4 ++-- == 1 file changed, 2 insertions(+), 2 deletions(-) == ==diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S ==index 53eeb226657c..c601d1de5ae5 100644 ==--- a/arch/x86/kernel/head_32.S ==+++ b/arch/x86/kernel/head_32.S ==@@ -63,8 +63,8 @@ == #endif == == /* Number of possible pages in the lowmem region */ ==-LOWMEM_PAGES = (((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT) ==- ==+LOWMEM_PAGES = (((2<<31) - __PAGE_OFFSET) >> PAGE_SHIFT) ==+ == /* Enough space to fit pagetables for the low memory linear map */ == MAPPING_BEYOND_END = PAGE_TABLE_SIZE(LOWMEM_PAGES) << PAGE_SHIFT == ==-- ==2.3.5 == ==-- ==Regards/Gruss, ==Boris. == ==ECO tip #101: Trim your mails when you reply. ==-- == -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: X86 GIT GCC 5 compilation warning
Hi guys. First of all - thank you for the discussion, and everything. I am on arch linux, regularly upgraded. $ as --version GNU assembler (GNU Binutils) 2.25.0 Copyright (C) 2014 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty. This assembler was configured for a target of `i686-pc-linux-gnu'. I attach you the PKGBUILD file - the brilliant Arch team made the entire system so it's fairly easy to understand it. Enrico Mioso # $Id: PKGBUILD 239643 2015-05-21 23:12:04Z allan $ # Maintainer: Allan McRae # toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc # build from head of release branch as bug fix releases are rare pkgname=binutils pkgver=2.25 pkgrel=5 _commit=69352378 pkgdesc="A set of programs to assemble and manipulate binary and object files" arch=('i686' 'x86_64') url="http://www.gnu.org/software/binutils/; license=('GPL') groups=('base-devel') depends=('glibc>=2.20' 'zlib') makedepends=('git') checkdepends=('dejagnu' 'bc') conflicts=('binutils-multilib') replaces=('binutils-multilib') options=('staticlibs' '!distcc' '!ccache') install=binutils.install source=(git://sourceware.org/git/binutils-gdb.git#commit=${_commit} binutils-e9c1bdad.patch) md5sums=('SKIP' 'eb3aceaab8ed26e06d505f82beb30f8f') prepare() { cd ${srcdir}/binutils-gdb # https://sourceware.org/bugzilla/show_bug.cgi?id=16992 patch -p1 -i ${srcdir}/binutils-e9c1bdad.patch # hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS" sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure mkdir ${srcdir}/binutils-build } build() { cd ${srcdir}/binutils-build ${srcdir}/binutils-gdb/configure --prefix=/usr \ --with-lib-path=/usr/lib:/usr/local/lib \ --with-bugurl=https://bugs.archlinux.org/ \ --enable-threads --enable-shared --with-pic \ --enable-ld=default --enable-gold --enable-plugins \ --disable-werror --disable-gdb # check the host environment and makes sure all the necessary tools are available make configure-host make tooldir=/usr } check() { cd ${srcdir}/binutils-build # unset LDFLAGS as testsuite makes assumptions about which ones are active # ignore failures in gold testsuite... make -k LDFLAGS="" check || true } package() { cd ${srcdir}/binutils-build make prefix=${pkgdir}/usr tooldir=${pkgdir}/usr install # Remove unwanted files rm ${pkgdir}/usr/share/man/man1/{dlltool,nlmconv,windres,windmc}* # No shared linking to these files outside binutils rm ${pkgdir}/usr/lib/lib{bfd,opcodes}.so } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: X86 GIT GCC 5 compilation warning
Hi guys. First of all - thank you for the discussion, and everything. I am on arch linux, regularly upgraded. $ as --version GNU assembler (GNU Binutils) 2.25.0 Copyright (C) 2014 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty. This assembler was configured for a target of `i686-pc-linux-gnu'. I attach you the PKGBUILD file - the brilliant Arch team made the entire system so it's fairly easy to understand it. Enrico Mioso # $Id: PKGBUILD 239643 2015-05-21 23:12:04Z allan $ # Maintainer: Allan McRae al...@archlinux.org # toolchain build order: linux-api-headers-glibc-binutils-gcc-binutils-glibc # build from head of release branch as bug fix releases are rare pkgname=binutils pkgver=2.25 pkgrel=5 _commit=69352378 pkgdesc=A set of programs to assemble and manipulate binary and object files arch=('i686' 'x86_64') url=http://www.gnu.org/software/binutils/; license=('GPL') groups=('base-devel') depends=('glibc=2.20' 'zlib') makedepends=('git') checkdepends=('dejagnu' 'bc') conflicts=('binutils-multilib') replaces=('binutils-multilib') options=('staticlibs' '!distcc' '!ccache') install=binutils.install source=(git://sourceware.org/git/binutils-gdb.git#commit=${_commit} binutils-e9c1bdad.patch) md5sums=('SKIP' 'eb3aceaab8ed26e06d505f82beb30f8f') prepare() { cd ${srcdir}/binutils-gdb # https://sourceware.org/bugzilla/show_bug.cgi?id=16992 patch -p1 -i ${srcdir}/binutils-e9c1bdad.patch # hack! - libiberty configure tests for header files using $CPP $CPPFLAGS sed -i /ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/ libiberty/configure mkdir ${srcdir}/binutils-build } build() { cd ${srcdir}/binutils-build ${srcdir}/binutils-gdb/configure --prefix=/usr \ --with-lib-path=/usr/lib:/usr/local/lib \ --with-bugurl=https://bugs.archlinux.org/ \ --enable-threads --enable-shared --with-pic \ --enable-ld=default --enable-gold --enable-plugins \ --disable-werror --disable-gdb # check the host environment and makes sure all the necessary tools are available make configure-host make tooldir=/usr } check() { cd ${srcdir}/binutils-build # unset LDFLAGS as testsuite makes assumptions about which ones are active # ignore failures in gold testsuite... make -k LDFLAGS= check || true } package() { cd ${srcdir}/binutils-build make prefix=${pkgdir}/usr tooldir=${pkgdir}/usr install # Remove unwanted files rm ${pkgdir}/usr/share/man/man1/{dlltool,nlmconv,windres,windmc}* # No shared linking to these files outside binutils rm ${pkgdir}/usr/lib/lib{bfd,opcodes}.so } -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: X86 GIT GCC 5 compilation warning
Hi Boris. thank you for the tested tag. I can confirm you that your patch fixed the warning. From my kernel compilation output: ... UPD kernel/config_data.h CC [M] kernel/configs.o LD arch/x86/kernel/cpu/built-in.o AS arch/x86/kernel/head_32.o LD arch/x86/kernel/built-in.o LD arch/x86/built-in.o CC [M] sound/hda/hdac_device.o I didn't boot-test it yet. On this system it will take a while to compile even due to high load conditions. When compilation it's over I'll kexec to this new kernel and let you know if there are any problems. Thank you again, Enrico Mioso On Tue, 16 Jun 2015, Borislav Petkov wrote: ==Date: Tue, 16 Jun 2015 15:58:01 ==From: Borislav Petkov b...@alien8.de ==To: Enrico Mioso mrkiko...@gmail.com ==Cc: Michael Matz m...@suse.de, linux-kernel@vger.kernel.org, ==x86-ml x...@kernel.org ==Subject: Re: X86 GIT GCC 5 compilation warning == ==On Tue, Jun 16, 2015 at 02:47:02PM +0200, Michael Matz wrote: == Yeah, building like so on i686 will produce an assembler that warns on == 132. == ==Enrico, try this. == ==--- ==From: Borislav Petkov b...@suse.de ==Date: Tue, 16 Jun 2015 15:43:27 +0200 ==Subject: [PATCH] x86/head_32: Fix overflow warning with 32-bit binutils == ==When building the kernel with 32-bit binutils built with support only ==for the i386 target, we get the following warning: == == arch/x86/kernel/head_32.S:66: Warning: shift count out of range (32 is not between 0 and 31) == ==The problem is that in that case, binutils' internal type representation ==is 32-bit wide and the shift range overflows. == ==In order to fix this, manipulate the shift expression which creates the ==4GiB constant to not overflow the shift count. == ==Reported-by: Enrico Mioso mrkiko...@gmail.com ==Suggested-by: Michael Matz m...@suse.de ==Signed-off-by: Borislav Petkov b...@suse.de ==--- == arch/x86/kernel/head_32.S | 4 ++-- == 1 file changed, 2 insertions(+), 2 deletions(-) == ==diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S ==index 53eeb226657c..c601d1de5ae5 100644 ==--- a/arch/x86/kernel/head_32.S ==+++ b/arch/x86/kernel/head_32.S ==@@ -63,8 +63,8 @@ == #endif == == /* Number of possible pages in the lowmem region */ ==-LOWMEM_PAGES = (((132) - __PAGE_OFFSET) PAGE_SHIFT) ==- ==+LOWMEM_PAGES = (((231) - __PAGE_OFFSET) PAGE_SHIFT) ==+ == /* Enough space to fit pagetables for the low memory linear map */ == MAPPING_BEYOND_END = PAGE_TABLE_SIZE(LOWMEM_PAGES) PAGE_SHIFT == ==-- ==2.3.5 == ==-- ==Regards/Gruss, ==Boris. == ==ECO tip #101: Trim your mails when you reply. ==-- == -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: X86 GIT GCC 5 compilation warning
Hi guys. I am running the new kernel - and all is well. Thank you. Enrico Mioso -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
X86 GIT GCC 5 compilation warning
Hi guys. Compiling my kernel with gcc (GCC) 5.1.0 the GIT snapshot as of commit c8d17b451aa18b07b60e771addf17a5fdd4138c7 I get the following warning you might be interested in: arch/x86/kernel/head_32.S:66: Warning: shift count out of range (32 is not between 0 and 31) My .config follows. Thank you for everything. Enrico # # Automatically generated file; DO NOT EDIT. # Linux/x86 4.1.0-rc7 Kernel Configuration # # CONFIG_64BIT is not set CONFIG_X86_32=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_PERF_EVENTS_INTEL_UNCORE=y CONFIG_OUTPUT_FORMAT="elf32-i386" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_MMU=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_X86_32_SMP=y CONFIG_X86_HT=y CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-ecx -fcall-saved-edx" CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_PGTABLE_LEVELS=2 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_EXTABLE_SORT=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION="hc" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y # CONFIG_KERNEL_GZIP is not set # CONFIG_KERNEL_BZIP2 is not set CONFIG_KERNEL_LZMA=y # CONFIG_KERNEL_XZ is not set # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set CONFIG_DEFAULT_HOSTNAME="(EEE1101HGo)" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_FHANDLE=y # CONFIG_USELIB is not set # CONFIG_AUDIT is not set CONFIG_HAVE_ARCH_AUDITSYSCALL=y # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_IRQ_DOMAIN=y CONFIG_GENERIC_MSI_IRQ=y # CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_GENERIC_CMOS_UPDATE=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_IRQ_TIME_ACCOUNTING is not set CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y # CONFIG_TASK_XACCT is not set # # RCU Subsystem # CONFIG_TREE_RCU=y CONFIG_SRCU=y # CONFIG_TASKS_RCU is not set CONFIG_RCU_STALL_COMMON=y CONFIG_RCU_FANOUT=32 CONFIG_RCU_FANOUT_LEAF=16 # CONFIG_RCU_FANOUT_EXACT is not set # CONFIG_RCU_FAST_NO_HZ is not set # CONFIG_TREE_RCU_TRACE is not set CONFIG_RCU_KTHREAD_PRIO=0 # CONFIG_RCU_NOCB_CPU is not set # CONFIG_RCU_EXPEDITE_BOOT is not set CONFIG_BUILD_BIN2C=y CONFIG_IKCONFIG=m CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y CONFIG_CGROUPS=y # CONFIG_CGROUP_DEBUG is not set CONFIG_CGROUP_FREEZER=y # CONFIG_CGROUP_DEVICE is not set # CONFIG_CPUSETS is not set CONFIG_CGROUP_CPUACCT=y CONFIG_PAGE_COUNTER=y CONFIG_MEMCG=y # CONFIG_MEMCG_SWAP is not set # CONFIG_MEMCG_KMEM is not set # CONFIG_CGROUP_PERF is not set # CONFIG_CGROUP_SCHED is not set # CONFIG_BLK_CGROUP is not set # CONFIG_CHECKPOINT_RESTORE is not set # CONFIG_NAMESPACES is not set # CONFIG_SCHED_AUTOGROUP is not set # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y # CONFIG_BLK_DEV_INITRD is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y CONFIG_ANON_INODES=y CONFIG_HAVE_UID16=y CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_HAVE_PCSPKR_PLATFORM=y CONFIG_BPF=y CONFIG_EXPERT=y CONFIG_UID16=y CONFIG_MULTIUSER=y # CONFIG_SGETMASK_SYSCALL is not set CONFIG_SYSFS_SYSCALL=y # CONFIG_SYSCTL_SYSCALL is not set # CONFIG_KALLSYMS is not set CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_PCSPKR_PLATFORM=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SIGNALFD=y CONFIG_TIMERFD=y CONFIG_EVENTFD=y # CONFIG_BPF_SYSCALL is not set CONFIG_SHMEM=y CONFIG_AIO=y CONFIG_ADVISE_SYSCALLS=y CONFIG_PCI_QUIRKS=y #
X86 GIT GCC 5 compilation warning
Hi guys. Compiling my kernel with gcc (GCC) 5.1.0 the GIT snapshot as of commit c8d17b451aa18b07b60e771addf17a5fdd4138c7 I get the following warning you might be interested in: arch/x86/kernel/head_32.S:66: Warning: shift count out of range (32 is not between 0 and 31) My .config follows. Thank you for everything. Enrico # # Automatically generated file; DO NOT EDIT. # Linux/x86 4.1.0-rc7 Kernel Configuration # # CONFIG_64BIT is not set CONFIG_X86_32=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_PERF_EVENTS_INTEL_UNCORE=y CONFIG_OUTPUT_FORMAT=elf32-i386 CONFIG_ARCH_DEFCONFIG=arch/x86/configs/i386_defconfig CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_MMU=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_X86_32_SMP=y CONFIG_X86_HT=y CONFIG_ARCH_HWEIGHT_CFLAGS=-fcall-saved-ecx -fcall-saved-edx CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_PGTABLE_LEVELS=2 CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_EXTABLE_SORT=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE= # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION=hc # CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y # CONFIG_KERNEL_GZIP is not set # CONFIG_KERNEL_BZIP2 is not set CONFIG_KERNEL_LZMA=y # CONFIG_KERNEL_XZ is not set # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set CONFIG_DEFAULT_HOSTNAME=(EEE1101HGo) CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_FHANDLE=y # CONFIG_USELIB is not set # CONFIG_AUDIT is not set CONFIG_HAVE_ARCH_AUDITSYSCALL=y # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_IRQ_DOMAIN=y CONFIG_GENERIC_MSI_IRQ=y # CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_GENERIC_CMOS_UPDATE=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_IRQ_TIME_ACCOUNTING is not set CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y # CONFIG_TASK_XACCT is not set # # RCU Subsystem # CONFIG_TREE_RCU=y CONFIG_SRCU=y # CONFIG_TASKS_RCU is not set CONFIG_RCU_STALL_COMMON=y CONFIG_RCU_FANOUT=32 CONFIG_RCU_FANOUT_LEAF=16 # CONFIG_RCU_FANOUT_EXACT is not set # CONFIG_RCU_FAST_NO_HZ is not set # CONFIG_TREE_RCU_TRACE is not set CONFIG_RCU_KTHREAD_PRIO=0 # CONFIG_RCU_NOCB_CPU is not set # CONFIG_RCU_EXPEDITE_BOOT is not set CONFIG_BUILD_BIN2C=y CONFIG_IKCONFIG=m CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y CONFIG_CGROUPS=y # CONFIG_CGROUP_DEBUG is not set CONFIG_CGROUP_FREEZER=y # CONFIG_CGROUP_DEVICE is not set # CONFIG_CPUSETS is not set CONFIG_CGROUP_CPUACCT=y CONFIG_PAGE_COUNTER=y CONFIG_MEMCG=y # CONFIG_MEMCG_SWAP is not set # CONFIG_MEMCG_KMEM is not set # CONFIG_CGROUP_PERF is not set # CONFIG_CGROUP_SCHED is not set # CONFIG_BLK_CGROUP is not set # CONFIG_CHECKPOINT_RESTORE is not set # CONFIG_NAMESPACES is not set # CONFIG_SCHED_AUTOGROUP is not set # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y # CONFIG_BLK_DEV_INITRD is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y CONFIG_ANON_INODES=y CONFIG_HAVE_UID16=y CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_HAVE_PCSPKR_PLATFORM=y CONFIG_BPF=y CONFIG_EXPERT=y CONFIG_UID16=y CONFIG_MULTIUSER=y # CONFIG_SGETMASK_SYSCALL is not set CONFIG_SYSFS_SYSCALL=y # CONFIG_SYSCTL_SYSCALL is not set # CONFIG_KALLSYMS is not set CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_PCSPKR_PLATFORM=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SIGNALFD=y CONFIG_TIMERFD=y CONFIG_EVENTFD=y # CONFIG_BPF_SYSCALL is not set CONFIG_SHMEM=y CONFIG_AIO=y CONFIG_ADVISE_SYSCALLS=y CONFIG_PCI_QUIRKS=y # CONFIG_EMBEDDED
Re: intensive IO on usb-storage device causing system lock
Thank you. If I'll be able I'll try. Thank you again guys. Enrico On Wed, 11 Feb 2015, Alan Stern wrote: Date: Wed, 11 Feb 2015 16:21:50 From: Alan Stern To: Enrico Mioso Cc: linux-...@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: intensive IO on usb-storage device causing system lock On Tue, 10 Feb 2015, Enrico Mioso wrote: Hello guys. the problem is still reproducible with final 3.19 kernel - I can confirm it. Re-sending the last trace here - don't know if it's available in cxg.de. Please stop posting these process traces. They don't help. Instead, post a usbmon trace showing what happens around the time when the problem occurs. If the trace file is quite large (which is likely, because usbmon can generate a lot of data in a short time), you can cut out everything up to the last few hundreds of KB before the problem starts. For those who might not have read the thread - the problem is: after some intensive IO to an USB (usb-storage) disk, for a more or less long time, depending on the quantity of IO you do, there start to be situations where some processes get stuck doing IO, in any case. Not IO to the USB disk, but IO also to other devices, like the one where the root partition resides, in my case a flash drive. I am using an EEE PC 701. That sounds like the problem may lie somewhere other than in the USB stack. But there's no way to tell without seeing a usbmon trace. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: intensive IO on usb-storage device causing system lock
It seems the problem is also triggerable without rtorrent, but other tools like git when checking out lots of files (in the kernel git repository for example). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: intensive IO on usb-storage device causing system lock
Thank you. If I'll be able I'll try. Thank you again guys. Enrico On Wed, 11 Feb 2015, Alan Stern wrote: Date: Wed, 11 Feb 2015 16:21:50 From: Alan Stern st...@rowland.harvard.edu To: Enrico Mioso mrkiko...@gmail.com Cc: linux-...@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: intensive IO on usb-storage device causing system lock On Tue, 10 Feb 2015, Enrico Mioso wrote: Hello guys. the problem is still reproducible with final 3.19 kernel - I can confirm it. Re-sending the last trace here - don't know if it's available in cxg.de. Please stop posting these process traces. They don't help. Instead, post a usbmon trace showing what happens around the time when the problem occurs. If the trace file is quite large (which is likely, because usbmon can generate a lot of data in a short time), you can cut out everything up to the last few hundreds of KB before the problem starts. For those who might not have read the thread - the problem is: after some intensive IO to an USB (usb-storage) disk, for a more or less long time, depending on the quantity of IO you do, there start to be situations where some processes get stuck doing IO, in any case. Not IO to the USB disk, but IO also to other devices, like the one where the root partition resides, in my case a flash drive. I am using an EEE PC 701. That sounds like the problem may lie somewhere other than in the USB stack. But there's no way to tell without seeing a usbmon trace. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: intensive IO on usb-storage device causing system lock
It seems the problem is also triggerable without rtorrent, but other tools like git when checking out lots of files (in the kernel git repository for example). -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: intensive IO on usb-storage device causing system lock
Hello guys. the problem is still reproducible with final 3.19 kernel - I can confirm it. Re-sending the last trace here - don't know if it's available in cxg.de. For those who might not have read the thread - the problem is: after some intensive IO to an USB (usb-storage) disk, for a more or less long time, depending on the quantity of IO you do, there start to be situations where some processes get stuck doing IO, in any case. Not IO to the USB disk, but IO also to other devices, like the one where the root partition resides, in my case a flash drive. I am using an EEE PC 701. I am sending the last trace I have: if you need more infos, then tell me. thank you. [10170.160485] SysRq : Show State [10170.160765] taskPC stack pid father [10170.160995] systemd S c0044000 0 1 0 0x [10170.161360] c0049eec 0086 c0049fec c0044000 c0044000 0246 c0049ef4 [10170.161956] c12bc120 dec31300 c0049ec8 c120a98d c12bc120 de2736c0 de1d5500 de21ab40 [10170.162572] c0049ed4 c10c8194 de1d550c c0049f0c c10c8352 62e136dd [10170.163181] Call Trace: [10170.163417] [] ? sock_poll+0xd0/0xd9 [10170.163652] [] ? ep_item_poll+0x15/0x1b [10170.163882] [] ? ep_send_events_proc+0x8c/0x13c [10170.164130] [] schedule+0x57/0x59 [10170.164357] [] schedule_hrtimeout_range_clock+0x35/0xc2 [10170.164595] [] ? ep_pm_stay_awake+0x11/0x11 [10170.164829] [] ? ep_scan_ready_list+0x128/0x150 [10170.165076] [] schedule_hrtimeout_range+0xa/0xc [10170.165309] [] SYSC_epoll_wait+0x223/0x26f [10170.165546] [] ? wake_up_process+0x2c/0x2c [10170.165779] [] SyS_epoll_wait+0x14/0x16 [10170.166023] [] sysenter_do_call+0x12/0x12 [10170.166253] kthreaddS c0044410 0 2 0 0x [10170.166580] c0051f8c 0046 c0051fec c0044410 c0044410 c1037361 0246 d1acc295 [10170.167189] c02e9c70 c0051f80 c10238cc 0dd9 d01e9880 00800711 [10170.167790] 0010 c0044410 d1acc295 c1033cce c084b160 d1acc295 c13de904 [10170.168401] Call Trace: [10170.168623] [] ? wake_up_new_task+0x53/0x6a [10170.168859] [] ? do_fork+0x1a3/0x1cd [10170.169101] [] ? init_completion+0x1e/0x1e [10170.169334] [] schedule+0x57/0x59 [10170.169564] [] kthreadd+0x60/0xbb [10170.169794] [] ret_from_kernel_thread+0x20/0x30 [10170.170037] [] ? kthread_create_on_cpu+0x43/0x43 [10170.170269] ksoftirqd/0 S c0044820 0 3 2 0x [10170.170594] c0053f4c 0046 c0053fec c0044820 c0044820 c0053f0c c0053f0c 0246 [10170.171213] c0053f14 c11a2d9a 02053f0c 0256 c0053f20 0046 c144a7bc c0053f4c [10170.171811] c1025f25 0006 c0053fec 000a 04208040 1357d7a2 c0099460 [10170.172421] Call Trace: [10170.172653] [] ? kbd_bh+0x41/0x78 [10170.172886] [] ? __do_softirq+0x122/0x16f [10170.173131] [] schedule+0x57/0x59 [10170.173361] [] smpboot_thread_fn+0xda/0x103 [10170.173593] [] ? SyS_setgroups+0x9d/0x9d [10170.173822] [] kthread+0x97/0x9c [10170.174061] [] ret_from_kernel_thread+0x20/0x30 [10170.174294] [] ? init_completion+0x1e/0x1e [10170.174514] kworker/0:0HS c0045040 0 5 2 0x [10170.174837] c005bf40 0046 c005bfec c0045040 c0045040 de8568a0 d5e040d4 0003 [10170.175445] d5e7d800 c02d0730 c02d0730 c13de55c c02d07c4 c005bf18 c112e9fa c00267e0 [10170.176051] c005bf28 c1030f0c c00267e0 c13de55c c005bf48 c1031309 552dad3f c00267e0 [10170.176647] Call Trace: [10170.176878] [] ? __blk_run_queue_uncond+0x1d/0x26 [10170.177125] [] ? pwq_dec_nr_in_flight+0x54/0x68 [10170.177360] [] ? process_one_work+0x197/0x19f [10170.177596] [] schedule+0x57/0x59 [10170.177826] [] worker_thread+0x1c4/0x207 [10170.178068] [] ? rescuer_thread+0x1f1/0x1f1 [10170.178301] [] kthread+0x97/0x9c [10170.178531] [] ret_from_kernel_thread+0x20/0x30 [10170.178764] [] ? init_completion+0x1e/0x1e [10170.178992] khelper S c0045860 0 7 2 0x [10170.179332] c0063f20 0046 c0063fec c0045860 c0045860 c0063edc c103a0b8 [10170.179932] c13df200 c0063ef0 c103b27e c13df1c0 c128e4a0 ffec c0063f08 c1036713 [10170.180540] c0045860 c0045860 0293 c0063f28 c1036866 ba37febc c00268a0 [10170.181147] Call Trace: [10170.181369] [] ? hrtick_update+0x12/0x35 [10170.181600] [] ? enqueue_task_fair+0x69/0x6e [10170.192440] [] ? enqueue_task+0x23/0x29 [10170.192672] [] ? set_user_nice+0xbe/0xd7 [10170.192907] [] ? process_scheduled_works+0x21/0x21 [10170.193151] [] schedule+0x57/0x59 [10170.193381] [] rescuer_thread+0x1e4/0x1f1 [10170.193614] [] ? process_scheduled_works+0x21/0x21 [10170.193848] [] ? process_scheduled_works+0x21/0x21 [10170.194092] [] kthread+0x97/0x9c [10170.194323] [] ret_from_kernel_thread+0x20/0x30 [10170.194558] [] ? init_completion+0x1e/0x1e [10170.194791] kdevtmpfs S c0045c70 0 8 2 0x [10170.195125] c0065ee0 0046 c0065fec c0045c70 c0045c70 d7de1c44 d7de1c7c
Re: intensive IO on usb-storage device causing system lock
Hello guys. the problem is still reproducible with final 3.19 kernel - I can confirm it. Re-sending the last trace here - don't know if it's available in cxg.de. For those who might not have read the thread - the problem is: after some intensive IO to an USB (usb-storage) disk, for a more or less long time, depending on the quantity of IO you do, there start to be situations where some processes get stuck doing IO, in any case. Not IO to the USB disk, but IO also to other devices, like the one where the root partition resides, in my case a flash drive. I am using an EEE PC 701. I am sending the last trace I have: if you need more infos, then tell me. thank you. [10170.160485] SysRq : Show State [10170.160765] taskPC stack pid father [10170.160995] systemd S c0044000 0 1 0 0x [10170.161360] c0049eec 0086 c0049fec c0044000 c0044000 0246 c0049ef4 [10170.161956] c12bc120 dec31300 c0049ec8 c120a98d c12bc120 de2736c0 de1d5500 de21ab40 [10170.162572] c0049ed4 c10c8194 de1d550c c0049f0c c10c8352 62e136dd [10170.163181] Call Trace: [10170.163417] [c120a98d] ? sock_poll+0xd0/0xd9 [10170.163652] [c10c8194] ? ep_item_poll+0x15/0x1b [10170.163882] [c10c8352] ? ep_send_events_proc+0x8c/0x13c [10170.164130] [c12815ef] schedule+0x57/0x59 [10170.164357] [c1282ade] schedule_hrtimeout_range_clock+0x35/0xc2 [10170.164595] [c10c82c6] ? ep_pm_stay_awake+0x11/0x11 [10170.164829] [c10c8907] ? ep_scan_ready_list+0x128/0x150 [10170.165076] [c1282b75] schedule_hrtimeout_range+0xa/0xc [10170.165309] [c10c8e93] SYSC_epoll_wait+0x223/0x26f [10170.165546] [c1036dd5] ? wake_up_process+0x2c/0x2c [10170.165779] [c10c9604] SyS_epoll_wait+0x14/0x16 [10170.166023] [c128304c] sysenter_do_call+0x12/0x12 [10170.166253] kthreaddS c0044410 0 2 0 0x [10170.166580] c0051f8c 0046 c0051fec c0044410 c0044410 c1037361 0246 d1acc295 [10170.167189] c02e9c70 c0051f80 c10238cc 0dd9 d01e9880 00800711 [10170.167790] 0010 c0044410 d1acc295 c1033cce c084b160 d1acc295 c13de904 [10170.168401] Call Trace: [10170.168623] [c1037361] ? wake_up_new_task+0x53/0x6a [10170.168859] [c10238cc] ? do_fork+0x1a3/0x1cd [10170.169101] [c1033cce] ? init_completion+0x1e/0x1e [10170.169334] [c12815ef] schedule+0x57/0x59 [10170.169564] [c10342b2] kthreadd+0x60/0xbb [10170.169794] [c1282f80] ret_from_kernel_thread+0x20/0x30 [10170.170037] [c1034252] ? kthread_create_on_cpu+0x43/0x43 [10170.170269] ksoftirqd/0 S c0044820 0 3 2 0x [10170.170594] c0053f4c 0046 c0053fec c0044820 c0044820 c0053f0c c0053f0c 0246 [10170.171213] c0053f14 c11a2d9a 02053f0c 0256 c0053f20 0046 c144a7bc c0053f4c [10170.171811] c1025f25 0006 c0053fec 000a 04208040 1357d7a2 c0099460 [10170.172421] Call Trace: [10170.172653] [c11a2d9a] ? kbd_bh+0x41/0x78 [10170.172886] [c1025f25] ? __do_softirq+0x122/0x16f [10170.173131] [c12815ef] schedule+0x57/0x59 [10170.173361] [c1036044] smpboot_thread_fn+0xda/0x103 [10170.173593] [c1035f6a] ? SyS_setgroups+0x9d/0x9d [10170.173822] [c1033d65] kthread+0x97/0x9c [10170.174061] [c1282f80] ret_from_kernel_thread+0x20/0x30 [10170.174294] [c1033cce] ? init_completion+0x1e/0x1e [10170.174514] kworker/0:0HS c0045040 0 5 2 0x [10170.174837] c005bf40 0046 c005bfec c0045040 c0045040 de8568a0 d5e040d4 0003 [10170.175445] d5e7d800 c02d0730 c02d0730 c13de55c c02d07c4 c005bf18 c112e9fa c00267e0 [10170.176051] c005bf28 c1030f0c c00267e0 c13de55c c005bf48 c1031309 552dad3f c00267e0 [10170.176647] Call Trace: [10170.176878] [c112e9fa] ? __blk_run_queue_uncond+0x1d/0x26 [10170.177125] [c1030f0c] ? pwq_dec_nr_in_flight+0x54/0x68 [10170.177360] [c1031309] ? process_one_work+0x197/0x19f [10170.177596] [c12815ef] schedule+0x57/0x59 [10170.177826] [c10316e7] worker_thread+0x1c4/0x207 [10170.178068] [c1031523] ? rescuer_thread+0x1f1/0x1f1 [10170.178301] [c1033d65] kthread+0x97/0x9c [10170.178531] [c1282f80] ret_from_kernel_thread+0x20/0x30 [10170.178764] [c1033cce] ? init_completion+0x1e/0x1e [10170.178992] khelper S c0045860 0 7 2 0x [10170.179332] c0063f20 0046 c0063fec c0045860 c0045860 c0063edc c103a0b8 [10170.179932] c13df200 c0063ef0 c103b27e c13df1c0 c128e4a0 ffec c0063f08 c1036713 [10170.180540] c0045860 c0045860 0293 c0063f28 c1036866 ba37febc c00268a0 [10170.181147] Call Trace: [10170.181369] [c103a0b8] ? hrtick_update+0x12/0x35 [10170.181600] [c103b27e] ? enqueue_task_fair+0x69/0x6e [10170.192440] [c1036713] ? enqueue_task+0x23/0x29 [10170.192672] [c1036866] ? set_user_nice+0xbe/0xd7 [10170.192907] [c1031332] ? process_scheduled_works+0x21/0x21 [10170.193151] [c12815ef] schedule+0x57/0x59 [10170.193381] [c1031516] rescuer_thread+0x1e4/0x1f1 [10170.193614] [c1031332] ? process_scheduled_works+0x21/0x21
Re: Bug in mount options handling in EXT4?
That's fine - as long as we can say that a possibly very very big of "nobarrier" options could be stored some place in memory and cause damage. Thank you for the reply and attention. Please - don't remove me from CC as I am not subscribed to any list. Enrico -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Bug in mount options handling in EXT4?
Hello guys. I noticed from some time, that I can make mount options accumulate simply continously repeating them. By typing: sudo mount -t ext4 -o rw,noatime,nobarrier,nobarrier,nobarrier, ... I can get: $ dmesg | tail [ 216.075581] EXT4-fs (sdb): mounted filesystem without journal. Opts: nobarrier [ 472.851105] snd_hda_intel :00:1b.0: IRQ timing workaround is activated for card #0. Suggest a bigger bdl_pos_adj. [41950.250515] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier [42093.049879] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier [42095.673967] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier [42095.954595] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier [42096.220220] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier [42103.212371] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier,nobarrier [42128.137609] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier [42144.960612] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier But the problem seems limited to the filesystem messages / something like that: $ cat /proc/mounts /dev/root / ext4 rw,noatime,nobarrier 0 0 devtmpfs /dev devtmpfs rw,relatime,size=252428k,nr_inodes=63107,mode=755 0 0 sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0 devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0 tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0 tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0 cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0 cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0 cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 debugfs /sys/kernel/debug debugfs rw,relatime 0 0 tmpfs /tmp tmpfs rw 0 0 mqueue /dev/mqueue mqueue rw,relatime 0 0 tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=50516k,mode=700,uid=1000,gid=1000 0 0 /dev/sdc1 /mnt/trekstor ext4 rw,noatime,nobarrier 0 0 /dev/sdb /mnt/sd ext4 rw,noatime,nobarrier 0 0 thank you for reading this message, enrico -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Bug in mount options handling in EXT4?
Hello guys. I noticed from some time, that I can make mount options accumulate simply continously repeating them. By typing: sudo mount -t ext4 -o rw,noatime,nobarrier,nobarrier,nobarrier, ... I can get: $ dmesg | tail [ 216.075581] EXT4-fs (sdb): mounted filesystem without journal. Opts: nobarrier [ 472.851105] snd_hda_intel :00:1b.0: IRQ timing workaround is activated for card #0. Suggest a bigger bdl_pos_adj. [41950.250515] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier [42093.049879] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier [42095.673967] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier [42095.954595] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier [42096.220220] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier [42103.212371] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier,nobarrier [42128.137609] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier [42144.960612] EXT4-fs (sdc1): re-mounted. Opts: nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier,nobarrier But the problem seems limited to the filesystem messages / something like that: $ cat /proc/mounts /dev/root / ext4 rw,noatime,nobarrier 0 0 devtmpfs /dev devtmpfs rw,relatime,size=252428k,nr_inodes=63107,mode=755 0 0 sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0 devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0 tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0 tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0 cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0 cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0 cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 debugfs /sys/kernel/debug debugfs rw,relatime 0 0 tmpfs /tmp tmpfs rw 0 0 mqueue /dev/mqueue mqueue rw,relatime 0 0 tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=50516k,mode=700,uid=1000,gid=1000 0 0 /dev/sdc1 /mnt/trekstor ext4 rw,noatime,nobarrier 0 0 /dev/sdb /mnt/sd ext4 rw,noatime,nobarrier 0 0 thank you for reading this message, enrico -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Bug in mount options handling in EXT4?
That's fine - as long as we can say that a possibly very very big of nobarrier options could be stored some place in memory and cause damage. Thank you for the reply and attention. Please - don't remove me from CC as I am not subscribed to any list. Enrico -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] net: qmi_wwan: Olivetti Olicard 200 support
:) I'm very happy you got it working. The firmware of our device seems so fragile still - and several QMI calls can bring it to a crashing state, especially when asking a network scan to the NAS service. On Tue, 15 Oct 2013, Dan Williams wrote: ==Date: Tue, 15 Oct 2013 09:49:57 -0500 ==From: Dan Williams ==To: Enrico Mioso ==Cc: gre...@linuxfoundation.org, da...@davemloft.net, bj...@mork.no, ==christian.schmi...@gemalto.com, linux-...@vger.kernel.org, ==net...@vger.kernel.org, linux-kernel@vger.kernel.org, ==Antonella Pellizzari ==Subject: Re: [PATCH] net: qmi_wwan: Olivetti Olicard 200 support == ==On Tue, 2013-10-15 at 15:06 +0200, Enrico Mioso wrote: ==> This is a QMI device, manufactured by TCT Mobile Phones. ==> A companion patch blacklisting this device's QMI interface in the option.c ==> driver has been sent. ==> ==> Signed-off-by: Enrico Mioso ==> Signed-off-by: Antonella Pellizzari == ==Good find. For the record, mine has: == ==PX1522E16X 1 [Oct 15 2010 02:00:00] == == ctl (1.4) == wds (1.8) == dms (1.3) == nas (1.2) == qos (1.2) == wms (1.1) == pds (1.4) == auth (1.0) == voice (1.0) == cat2 (1.1) == ==Tested-by: Dan Williams == ==> diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c ==> index 3d6aaf7..818ce90 100644 ==> --- a/drivers/net/usb/qmi_wwan.c ==> +++ b/drivers/net/usb/qmi_wwan.c ==> @@ -714,6 +714,7 @@ static const struct usb_device_id products[] = { ==> {QMI_FIXED_INTF(0x2357, 0x0201, 4)},/* TP-LINK HSUPA Modem MA180 */ ==> {QMI_FIXED_INTF(0x2357, 0x9000, 4)},/* TP-LINK MA260 */ ==> {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)},/* Telit LE920 */ ==> + {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)},/* Olivetti Olicard 200 */ ==> {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)},/* Cinterion PLxx */ ==> ==> /* 4. Gobi 1000 devices */ == == == -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: serial: option: blacklist Olivetti Olicard200
Interface 6 of this device speaks QMI as per tests done by us. Credits go to Antonella for providing the hardware. Signed-off-by: Enrico Mioso Signed-off-by: Antonella Pellizzari diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 80a7104..d7c10d6 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -1257,7 +1257,9 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) }, - { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200) }, + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200), + .driver_info = (kernel_ulong_t)_intf6_blacklist + }, { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/ { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) }, -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] net: qmi_wwan: Olivetti Olicard 200 support
This is a QMI device, manufactured by TCT Mobile Phones. A companion patch blacklisting this device's QMI interface in the option.c driver has been sent. Signed-off-by: Enrico Mioso Signed-off-by: Antonella Pellizzari diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 3d6aaf7..818ce90 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -714,6 +714,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x2357, 0x0201, 4)},/* TP-LINK HSUPA Modem MA180 */ {QMI_FIXED_INTF(0x2357, 0x9000, 4)},/* TP-LINK MA260 */ {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)},/* Telit LE920 */ + {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)},/* Olivetti Olicard 200 */ {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)},/* Cinterion PLxx */ /* 4. Gobi 1000 devices */ -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] net: qmi_wwan: Olivetti Olicard 200 support
This is a QMI device, manufactured by TCT Mobile Phones. A companion patch blacklisting this device's QMI interface in the option.c driver has been sent. Signed-off-by: Enrico Mioso mrkiko...@gmail.com Signed-off-by: Antonella Pellizzari anto.pellizzar...@gmail.com diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 3d6aaf7..818ce90 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -714,6 +714,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x2357, 0x0201, 4)},/* TP-LINK HSUPA Modem MA180 */ {QMI_FIXED_INTF(0x2357, 0x9000, 4)},/* TP-LINK MA260 */ {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)},/* Telit LE920 */ + {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)},/* Olivetti Olicard 200 */ {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)},/* Cinterion PLxx */ /* 4. Gobi 1000 devices */ -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: serial: option: blacklist Olivetti Olicard200
Interface 6 of this device speaks QMI as per tests done by us. Credits go to Antonella for providing the hardware. Signed-off-by: Enrico Mioso mrkiko...@gmail.com Signed-off-by: Antonella Pellizzari anto.pellizzar...@gmail.com diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 80a7104..d7c10d6 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -1257,7 +1257,9 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) }, - { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200) }, + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200), + .driver_info = (kernel_ulong_t)net_intf6_blacklist + }, { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/ { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) }, -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] net: qmi_wwan: Olivetti Olicard 200 support
:) I'm very happy you got it working. The firmware of our device seems so fragile still - and several QMI calls can bring it to a crashing state, especially when asking a network scan to the NAS service. On Tue, 15 Oct 2013, Dan Williams wrote: ==Date: Tue, 15 Oct 2013 09:49:57 -0500 ==From: Dan Williams d...@redhat.com ==To: Enrico Mioso mrkiko...@gmail.com ==Cc: gre...@linuxfoundation.org, da...@davemloft.net, bj...@mork.no, ==christian.schmi...@gemalto.com, linux-...@vger.kernel.org, ==net...@vger.kernel.org, linux-kernel@vger.kernel.org, ==Antonella Pellizzari anto.pellizzar...@gmail.com ==Subject: Re: [PATCH] net: qmi_wwan: Olivetti Olicard 200 support == ==On Tue, 2013-10-15 at 15:06 +0200, Enrico Mioso wrote: == This is a QMI device, manufactured by TCT Mobile Phones. == A companion patch blacklisting this device's QMI interface in the option.c == driver has been sent. == == Signed-off-by: Enrico Mioso mrkiko...@gmail.com == Signed-off-by: Antonella Pellizzari anto.pellizzar...@gmail.com == ==Good find. For the record, mine has: == ==PX1522E16X 1 [Oct 15 2010 02:00:00] == == ctl (1.4) == wds (1.8) == dms (1.3) == nas (1.2) == qos (1.2) == wms (1.1) == pds (1.4) == auth (1.0) == voice (1.0) == cat2 (1.1) == ==Tested-by: Dan Williams d...@redhat.com == == diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c == index 3d6aaf7..818ce90 100644 == --- a/drivers/net/usb/qmi_wwan.c == +++ b/drivers/net/usb/qmi_wwan.c == @@ -714,6 +714,7 @@ static const struct usb_device_id products[] = { == {QMI_FIXED_INTF(0x2357, 0x0201, 4)},/* TP-LINK HSUPA Modem MA180 */ == {QMI_FIXED_INTF(0x2357, 0x9000, 4)},/* TP-LINK MA260 */ == {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)},/* Telit LE920 */ == + {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)},/* Olivetti Olicard 200 */ == {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)},/* Cinterion PLxx */ == == /* 4. Gobi 1000 devices */ == == == -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH V5 net-next 0/3] The huawei_cdc_ncm driver
So this is a new, revised, edition of the huawei_cdc_ncm.c driver, which supports devices resembling the NCM standard, but using it also as a mean to encapsulate other protocols, as is the case for the Huawei E3131 and E3251 modem devices. Some precisations are needed however - and I encourage discussion on this: and that's why I'm sending this message with a broader CC. Merging those patches might change: - the way Modem Manager interacts with those devices - some regressions might be possible if there are some unknown firmware variants around (Franko?) First of all: I observed the behaviours of two devices. Huawei E3131: this device doesn't accept NDIS setup requests unless they're sent via the embedded AT channel exposed by this driver. So actually we gain funcionality in this case! The second case, is the Huawei E3251: which works with standard NCM driver, still exposing an AT embedded channel. Whith this patch set applied, you gain some funcionality, loosing the ability to catch standard NCM events for now. The device will work in both ways with no problems, but this has to be acknowledged and discussed. Might be we can develop this driver further to change this, when more devices are tested. We where thinking Huawei changed their interfaces on new devices - but probably this driver only works around a nice firmware bug present in E3131, which prevented the modem from being used in NDIS mode. I think committing this is definitely wortth-while, since it will allow for more Huawei devices to be used without serial connection. Some devices like the E3251 also, reports some status information only via the embedded AT channel, at least in my case. Note: I'm not subscribed to any list except the Modem Manager's one, so please CC me, thanks!! Enrico Mioso (3): net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver net: cdc_ncm: remove non-standard NCM device IDs drivers/net/usb/Kconfig | 15 +++ drivers/net/usb/Makefile | 1 + drivers/net/usb/cdc_ncm.c| 17 +-- drivers/net/usb/huawei_cdc_ncm.c | 228 +++ include/linux/usb/cdc_ncm.h | 3 + 5 files changed, 251 insertions(+), 13 deletions(-) create mode 100644 drivers/net/usb/huawei_cdc_ncm.c -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH V5 net-next 1/3] net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use
Some drivers implementing NCM-like protocols, may re-use those functions, as is the case in the huawei_cdc_ncm driver. Export them via EXPORT_SYMBOL_GPL, in accordance with how other functions have been exported. Signed-off-by: Enrico Mioso diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 43afde8..62686be 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -858,7 +858,7 @@ static void cdc_ncm_txpath_bh(unsigned long param) } } -static struct sk_buff * +struct sk_buff * cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) { struct sk_buff *skb_out; @@ -885,6 +885,7 @@ error: return NULL; } +EXPORT_SYMBOL_GPL(cdc_ncm_tx_fixup); /* verify NTB header and return offset of first NDP, or negative error */ int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in) @@ -965,7 +966,7 @@ error: } EXPORT_SYMBOL_GPL(cdc_ncm_rx_verify_ndp16); -static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) { struct sk_buff *skb; struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; @@ -1040,6 +1041,7 @@ err_ndp: error: return 0; } +EXPORT_SYMBOL_GPL(cdc_ncm_rx_fixup); static void cdc_ncm_speed_change(struct cdc_ncm_ctx *ctx, diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index cc25b70..163244b 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h @@ -133,3 +133,6 @@ extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in); extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset); +struct sk_buff * +cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags); +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in); -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH V5 net-next 3/3] net: cdc_ncm: remove non-standard NCM device IDs
Remove device IDs of NCM-like (but not NCM-conformant) devices, that are handled by the huawwei_cdc_ncm driver now. Signed-off-by: Enrico Mioso diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 62686be..31f43f7 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -1236,17 +1236,6 @@ static const struct usb_device_id cdc_devs[] = { .driver_info = (unsigned long)_info, }, - /* Huawei NCM devices disguised as vendor specific */ - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x16), - .driver_info = (unsigned long)_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46), - .driver_info = (unsigned long)_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76), - .driver_info = (unsigned long)_info, - }, - /* Infineon(now Intel) HSPA Modem platform */ { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443, USB_CLASS_COMM, -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH V5 net-next 2/3] net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver
This driver supports devices using the NCM protocol as an encapsulation layer for other protocols, like the E3131 Huawei 3G modem. This drivers approach was heavily inspired by the qmi_wwan/cdc_mbim approach & code model. Suggested-by: Bjorn Mork Signed-off-by: Enrico Mioso create mode 100644 drivers/net/usb/huawei_cdc_ncm.c diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index 40db312..85e4a01 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig @@ -242,6 +242,21 @@ config USB_NET_CDC_NCM * ST-Ericsson M343 HSPA Mobile Broadband Modem (reference design) * Ericsson F5521gw Mobile Broadband Module +config USB_NET_HUAWEI_CDC_NCM + tristate "Huawei NCM embedded AT channel support" + depends on USB_USBNET + select USB_WDM + select USB_NET_CDC_NCM + help + This driver supports huawei-style NCM devices, that use NCM as a + transport for other protocols, usually an embedded AT channel. + Good examples are: + * Huawei E3131 + * Huawei E3251 + + To compile this driver as a module, choose M here: the module will be + called huawei_cdc_ncm.ko. + config USB_NET_CDC_MBIM tristate "CDC MBIM support" depends on USB_USBNET diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile index 8b342cf..b17b5e8 100644 --- a/drivers/net/usb/Makefile +++ b/drivers/net/usb/Makefile @@ -32,6 +32,7 @@ obj-$(CONFIG_USB_IPHETH) += ipheth.o obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o +obj-$(CONFIG_USB_NET_HUAWEI_CDC_NCM) += huawei_cdc_ncm.o obj-$(CONFIG_USB_VL600)+= lg-vl600.o obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o diff --git a/drivers/net/usb/huawei_cdc_ncm.c b/drivers/net/usb/huawei_cdc_ncm.c new file mode 100644 index 000..ff07b18 --- /dev/null +++ b/drivers/net/usb/huawei_cdc_ncm.c @@ -0,0 +1,228 @@ +/* huawei_cdc_ncm.c - handles Huawei devices using the CDC NCM protocol as + * transport layer. + * Copyright (C) 2013 Enrico Mioso + * + * + * ABSTRACT: + * This driver handles devices resembling the CDC NCM standard, but + * encapsulating another protocol inside it. An example are some Huawei 3G + * devices, exposing an embedded AT channel where you can set up the NCM + * connection. + * This code has been heavily inspired by the cdc_mbim.c driver, which is + * Copyright (c) 2012 Smith Micro Software, Inc. + * Copyright (c) 2012 Bjørn Mork + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Driver data */ +struct huawei_cdc_ncm_state { + struct cdc_ncm_ctx *ctx; + atomic_t pmcount; + struct usb_driver *subdriver; + struct usb_interface *control; + struct usb_interface *data; +}; + +static int huawei_cdc_ncm_manage_power(struct usbnet *usbnet_dev, int on) +{ + struct huawei_cdc_ncm_state *drvstate = (void *)_dev->data; + int rv = 0; + + if ((on && atomic_add_return(1, >pmcount) == 1) || + (!on && atomic_dec_and_test(>pmcount))) { + rv = usb_autopm_get_interface(usbnet_dev->intf); + if (rv < 0) + goto err; + usbnet_dev->intf->needs_remote_wakeup = on; + usb_autopm_put_interface(usbnet_dev->intf); + } +err: + return rv; +} + +static int huawei_cdc_ncm_wdm_manage_power(struct usb_interface *intf, int status) +{ + struct usbnet *usbnet_dev = usb_get_intfdata(intf); + + /* can be called while disconnecting */ + if (!usbnet_dev) + return 0; + + return huawei_cdc_ncm_manage_power(usbnet_dev, status); +} + + +static int huawei_cdc_ncm_bind(struct usbnet *usbnet_dev, struct usb_interface *intf) +{ + struct cdc_ncm_ctx *ctx; + struct usb_driver *subdriver = ERR_PTR(-ENODEV); + int ret = -ENODEV; + struct huawei_cdc_ncm_state *drvstate = (void *)_dev->data; + + /* altsetting should always be 1 for NCM devices - so we hard-coded +* it here +*/ + ret = cdc_ncm_bind_common(usbnet_dev, intf, 1); + if (ret) + goto err; + + ctx = drvstate->ctx; + + if (usbnet_dev->status) + /* CDC-WMC r1.1 requires wMaxCommand to be "at least 256 +* decimal (0x100)" +*/ + subdriver = usb_cdc_wdm_register(ctx->control, +_d
[PATCH V5 net-next 3/3] net: cdc_ncm: remove non-standard NCM device IDs
Remove device IDs of NCM-like (but not NCM-conformant) devices, that are handled by the huawwei_cdc_ncm driver now. Signed-off-by: Enrico Mioso mrkiko...@gmail.com diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 62686be..31f43f7 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -1236,17 +1236,6 @@ static const struct usb_device_id cdc_devs[] = { .driver_info = (unsigned long)wwan_info, }, - /* Huawei NCM devices disguised as vendor specific */ - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x16), - .driver_info = (unsigned long)wwan_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46), - .driver_info = (unsigned long)wwan_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76), - .driver_info = (unsigned long)wwan_info, - }, - /* Infineon(now Intel) HSPA Modem platform */ { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443, USB_CLASS_COMM, -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH V5 net-next 2/3] net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver
This driver supports devices using the NCM protocol as an encapsulation layer for other protocols, like the E3131 Huawei 3G modem. This drivers approach was heavily inspired by the qmi_wwan/cdc_mbim approach code model. Suggested-by: Bjorn Mork bj...@mork.no Signed-off-by: Enrico Mioso mrkiko...@gmail.com create mode 100644 drivers/net/usb/huawei_cdc_ncm.c diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index 40db312..85e4a01 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig @@ -242,6 +242,21 @@ config USB_NET_CDC_NCM * ST-Ericsson M343 HSPA Mobile Broadband Modem (reference design) * Ericsson F5521gw Mobile Broadband Module +config USB_NET_HUAWEI_CDC_NCM + tristate Huawei NCM embedded AT channel support + depends on USB_USBNET + select USB_WDM + select USB_NET_CDC_NCM + help + This driver supports huawei-style NCM devices, that use NCM as a + transport for other protocols, usually an embedded AT channel. + Good examples are: + * Huawei E3131 + * Huawei E3251 + + To compile this driver as a module, choose M here: the module will be + called huawei_cdc_ncm.ko. + config USB_NET_CDC_MBIM tristate CDC MBIM support depends on USB_USBNET diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile index 8b342cf..b17b5e8 100644 --- a/drivers/net/usb/Makefile +++ b/drivers/net/usb/Makefile @@ -32,6 +32,7 @@ obj-$(CONFIG_USB_IPHETH) += ipheth.o obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o +obj-$(CONFIG_USB_NET_HUAWEI_CDC_NCM) += huawei_cdc_ncm.o obj-$(CONFIG_USB_VL600)+= lg-vl600.o obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o diff --git a/drivers/net/usb/huawei_cdc_ncm.c b/drivers/net/usb/huawei_cdc_ncm.c new file mode 100644 index 000..ff07b18 --- /dev/null +++ b/drivers/net/usb/huawei_cdc_ncm.c @@ -0,0 +1,228 @@ +/* huawei_cdc_ncm.c - handles Huawei devices using the CDC NCM protocol as + * transport layer. + * Copyright (C) 2013 Enrico Mioso mrkiko...@gmail.com + * + * + * ABSTRACT: + * This driver handles devices resembling the CDC NCM standard, but + * encapsulating another protocol inside it. An example are some Huawei 3G + * devices, exposing an embedded AT channel where you can set up the NCM + * connection. + * This code has been heavily inspired by the cdc_mbim.c driver, which is + * Copyright (c) 2012 Smith Micro Software, Inc. + * Copyright (c) 2012 Bjørn Mork bj...@mork.no + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + */ + +#include linux/module.h +#include linux/netdevice.h +#include linux/ethtool.h +#include linux/if_vlan.h +#include linux/ip.h +#include linux/mii.h +#include linux/usb.h +#include linux/usb/cdc.h +#include linux/usb/usbnet.h +#include linux/usb/cdc-wdm.h +#include linux/usb/cdc_ncm.h + +/* Driver data */ +struct huawei_cdc_ncm_state { + struct cdc_ncm_ctx *ctx; + atomic_t pmcount; + struct usb_driver *subdriver; + struct usb_interface *control; + struct usb_interface *data; +}; + +static int huawei_cdc_ncm_manage_power(struct usbnet *usbnet_dev, int on) +{ + struct huawei_cdc_ncm_state *drvstate = (void *)usbnet_dev-data; + int rv = 0; + + if ((on atomic_add_return(1, drvstate-pmcount) == 1) || + (!on atomic_dec_and_test(drvstate-pmcount))) { + rv = usb_autopm_get_interface(usbnet_dev-intf); + if (rv 0) + goto err; + usbnet_dev-intf-needs_remote_wakeup = on; + usb_autopm_put_interface(usbnet_dev-intf); + } +err: + return rv; +} + +static int huawei_cdc_ncm_wdm_manage_power(struct usb_interface *intf, int status) +{ + struct usbnet *usbnet_dev = usb_get_intfdata(intf); + + /* can be called while disconnecting */ + if (!usbnet_dev) + return 0; + + return huawei_cdc_ncm_manage_power(usbnet_dev, status); +} + + +static int huawei_cdc_ncm_bind(struct usbnet *usbnet_dev, struct usb_interface *intf) +{ + struct cdc_ncm_ctx *ctx; + struct usb_driver *subdriver = ERR_PTR(-ENODEV); + int ret = -ENODEV; + struct huawei_cdc_ncm_state *drvstate = (void *)usbnet_dev-data; + + /* altsetting should always be 1 for NCM devices - so we hard-coded +* it here +*/ + ret = cdc_ncm_bind_common(usbnet_dev, intf, 1); + if (ret) + goto err; + + ctx = drvstate-ctx; + + if (usbnet_dev-status) + /* CDC-WMC r1.1 requires wMaxCommand to be at least 256 +* decimal
[PATCH V5 net-next 0/3] The huawei_cdc_ncm driver
So this is a new, revised, edition of the huawei_cdc_ncm.c driver, which supports devices resembling the NCM standard, but using it also as a mean to encapsulate other protocols, as is the case for the Huawei E3131 and E3251 modem devices. Some precisations are needed however - and I encourage discussion on this: and that's why I'm sending this message with a broader CC. Merging those patches might change: - the way Modem Manager interacts with those devices - some regressions might be possible if there are some unknown firmware variants around (Franko?) First of all: I observed the behaviours of two devices. Huawei E3131: this device doesn't accept NDIS setup requests unless they're sent via the embedded AT channel exposed by this driver. So actually we gain funcionality in this case! The second case, is the Huawei E3251: which works with standard NCM driver, still exposing an AT embedded channel. Whith this patch set applied, you gain some funcionality, loosing the ability to catch standard NCM events for now. The device will work in both ways with no problems, but this has to be acknowledged and discussed. Might be we can develop this driver further to change this, when more devices are tested. We where thinking Huawei changed their interfaces on new devices - but probably this driver only works around a nice firmware bug present in E3131, which prevented the modem from being used in NDIS mode. I think committing this is definitely wortth-while, since it will allow for more Huawei devices to be used without serial connection. Some devices like the E3251 also, reports some status information only via the embedded AT channel, at least in my case. Note: I'm not subscribed to any list except the Modem Manager's one, so please CC me, thanks!! Enrico Mioso (3): net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver net: cdc_ncm: remove non-standard NCM device IDs drivers/net/usb/Kconfig | 15 +++ drivers/net/usb/Makefile | 1 + drivers/net/usb/cdc_ncm.c| 17 +-- drivers/net/usb/huawei_cdc_ncm.c | 228 +++ include/linux/usb/cdc_ncm.h | 3 + 5 files changed, 251 insertions(+), 13 deletions(-) create mode 100644 drivers/net/usb/huawei_cdc_ncm.c -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH V5 net-next 1/3] net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use
Some drivers implementing NCM-like protocols, may re-use those functions, as is the case in the huawei_cdc_ncm driver. Export them via EXPORT_SYMBOL_GPL, in accordance with how other functions have been exported. Signed-off-by: Enrico Mioso mrkiko...@gmail.com diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 43afde8..62686be 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -858,7 +858,7 @@ static void cdc_ncm_txpath_bh(unsigned long param) } } -static struct sk_buff * +struct sk_buff * cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) { struct sk_buff *skb_out; @@ -885,6 +885,7 @@ error: return NULL; } +EXPORT_SYMBOL_GPL(cdc_ncm_tx_fixup); /* verify NTB header and return offset of first NDP, or negative error */ int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in) @@ -965,7 +966,7 @@ error: } EXPORT_SYMBOL_GPL(cdc_ncm_rx_verify_ndp16); -static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) { struct sk_buff *skb; struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev-data[0]; @@ -1040,6 +1041,7 @@ err_ndp: error: return 0; } +EXPORT_SYMBOL_GPL(cdc_ncm_rx_fixup); static void cdc_ncm_speed_change(struct cdc_ncm_ctx *ctx, diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index cc25b70..163244b 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h @@ -133,3 +133,6 @@ extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in); extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset); +struct sk_buff * +cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags); +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in); -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RESEND V3 net-next 2/3] net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver
Hi guys!! :) First of all - I would like to thank both of you for your interest and time in my patches. I agree with Joe's point of view, completely. The Coding style document tries to leverage on the developer's good sense, even when defining some rules. Apart from that - checkpatch.po informed me about those very long lines, but I decided to leave them as they are due to the fact that they would look even more horrible than they look now. My braille display is 80-chars long (at least, the one I use normally), so I understand very well the problem of not passing that limit. Even so, the coding style says you might do so if you think the code is more readable this way, and that's why. My git usage is very bad as you may have observed (and I'm working on improving myself of course), but this was something I took into consideration. I remember when this cameto discussion: http://lkml.org/lkml/2009/12/17/229 still I know perfectly that one of the line you're blaming is indeed 139 characters. I understand and appreciate the fact that we _shouldn't_ take as reference worst cases (but only bbetter cases) to improve our practice & life, but in various drivers you can find examples like those. Is this still a problem? I will re-work the code and send the patch again as soon as I can. thank you again! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RESEND V3 net-next 2/3] net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver
Hi guys!! :) First of all - I would like to thank both of you for your interest and time in my patches. I agree with Joe's point of view, completely. The Coding style document tries to leverage on the developer's good sense, even when defining some rules. Apart from that - checkpatch.po informed me about those very long lines, but I decided to leave them as they are due to the fact that they would look even more horrible than they look now. My braille display is 80-chars long (at least, the one I use normally), so I understand very well the problem of not passing that limit. Even so, the coding style says you might do so if you think the code is more readable this way, and that's why. My git usage is very bad as you may have observed (and I'm working on improving myself of course), but this was something I took into consideration. I remember when this cameto discussion: http://lkml.org/lkml/2009/12/17/229 still I know perfectly that one of the line you're blaming is indeed 139 characters. I understand and appreciate the fact that we _shouldn't_ take as reference worst cases (but only bbetter cases) to improve our practice life, but in various drivers you can find examples like those. Is this still a problem? I will re-work the code and send the patch again as soon as I can. thank you again! -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND V3 net-next 1/3] net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use
Some drivers implementing NCM-like protocols, may re-use those functions, as is the case in the huawei_cdc_ncm driver. Export them via EXPORT_SYMBOL_GPL, in accordance with how other functions have been exported. Signed-off-by: Enrico Mioso --- drivers/net/usb/cdc_ncm.c |6 -- include/linux/usb/cdc_ncm.h |3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 43afde8..62686be 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -858,7 +858,7 @@ static void cdc_ncm_txpath_bh(unsigned long param) } } -static struct sk_buff * +struct sk_buff * cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) { struct sk_buff *skb_out; @@ -885,6 +885,7 @@ error: return NULL; } +EXPORT_SYMBOL_GPL(cdc_ncm_tx_fixup); /* verify NTB header and return offset of first NDP, or negative error */ int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in) @@ -965,7 +966,7 @@ error: } EXPORT_SYMBOL_GPL(cdc_ncm_rx_verify_ndp16); -static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) { struct sk_buff *skb; struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; @@ -1040,6 +1041,7 @@ err_ndp: error: return 0; } +EXPORT_SYMBOL_GPL(cdc_ncm_rx_fixup); static void cdc_ncm_speed_change(struct cdc_ncm_ctx *ctx, diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index cc25b70..163244b 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h @@ -133,3 +133,6 @@ extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in); extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset); +struct sk_buff * +cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags); +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND V3 net-next 3/3] net: cdc_ncm: remove non-standard NCM device IDs
Remove device IDs of NCM-like (but not NCM-conformant) devices, that are handled by the huawwei_cdc_ncm driver now. Signed-off-by: Enrico Mioso --- drivers/net/usb/cdc_ncm.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 62686be..31f43f7 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -1236,17 +1236,6 @@ static const struct usb_device_id cdc_devs[] = { .driver_info = (unsigned long)_info, }, - /* Huawei NCM devices disguised as vendor specific */ - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x16), - .driver_info = (unsigned long)_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46), - .driver_info = (unsigned long)_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76), - .driver_info = (unsigned long)_info, - }, - /* Infineon(now Intel) HSPA Modem platform */ { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443, USB_CLASS_COMM, -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND V3 net-next 0/3] huawei_cdc_ncm driver introduction
These patches are all related to the new huawei_cdc_ncm driver, supporting devices that use the NCM protocol as a transport layer for other protocols. this is the case of the Huawei E3131 3G modem. In this version - I actually added the driver file! :) I don't know how I ended up forgetting about it, I should have learned git usage better after all this time! Sorry for the time I wasted you. Enrico Mioso (3): net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver net: cdc_ncm: remove non-standard NCM device IDs drivers/net/usb/Kconfig | 11 ++ drivers/net/usb/Makefile |1 + drivers/net/usb/cdc_ncm.c| 17 +-- drivers/net/usb/huawei_cdc_ncm.c | 210 ++ include/linux/usb/cdc_ncm.h |3 + 5 files changed, 229 insertions(+), 13 deletions(-) create mode 100644 drivers/net/usb/huawei_cdc_ncm.c -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND V3 net-next 2/3] net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver
This driver supports devices using the NCM protocol as an encapsulation layer for other protocols, like the E3131 Huawei 3G modem. This drivers approach was heavily inspired by the qmi_wwan approach & code model. Suggested-by: Bjorn Mork Signed-off-by: Enrico Mioso --- drivers/net/usb/Kconfig | 11 ++ drivers/net/usb/Makefile |1 + drivers/net/usb/huawei_cdc_ncm.c | 210 ++ 3 files changed, 222 insertions(+) create mode 100644 drivers/net/usb/huawei_cdc_ncm.c diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index d84bfd4..6e56751 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig @@ -242,6 +242,17 @@ config USB_NET_CDC_NCM * ST-Ericsson M343 HSPA Mobile Broadband Modem (reference design) * Ericsson F5521gw Mobile Broadband Module +config USB_NET_HUAWEI_CDC_NCM + tristate "Huawei-style CDC NCM support" + depends on USB_USBNET + select USB_WDM + select USB_NET_CDC_NCM + help + This driver aims to support huawei-style NCM devices, that use ncm as a + transport for other protocols. + To compile this driver as a module, choose M here: the module will be + called huawei_cdc_ncm. + config USB_NET_CDC_MBIM tristate "CDC MBIM support" depends on USB_USBNET diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile index e817178..fd0e6a7 100644 --- a/drivers/net/usb/Makefile +++ b/drivers/net/usb/Makefile @@ -31,6 +31,7 @@ obj-$(CONFIG_USB_IPHETH) += ipheth.o obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o +obj-$(CONFIG_USB_NET_HUAWEI_CDC_NCM) += huawei_cdc_ncm.o obj-$(CONFIG_USB_VL600)+= lg-vl600.o obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o diff --git a/drivers/net/usb/huawei_cdc_ncm.c b/drivers/net/usb/huawei_cdc_ncm.c new file mode 100644 index 000..d3426b9 --- /dev/null +++ b/drivers/net/usb/huawei_cdc_ncm.c @@ -0,0 +1,210 @@ +/* + * huawei_cdc_ncm.c - handles huawei-style NCM devices. + * Copyright (C) 2013 Enrico Mioso + * This driver handles devices resembling the CDC NCM standard, but + * encapsulating another protocol inside it. An example are some Huawei 3G + * devices, exposing an embedded AT channel where you can set up the NCM + * connection. + * This code has been heavily inspired by the cdc_mbim.c driver, which is + * Copyright (c) 2012 Smith Micro Software, Inc. + * Copyright (c) 2012 Bjørn Mork + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Driver data */ +struct huawei_cdc_ncm_state { + struct cdc_ncm_ctx *ctx; + atomic_t pmcount; + struct usb_driver *subdriver; + struct usb_interface *control; + struct usb_interface *data; +}; + +static int huawei_cdc_ncm_manage_power(struct usbnet *usbnet_dev, int on) +{ + struct huawei_cdc_ncm_state *drvstate = (void *)_dev->data; + int rv = 0; + + if ((on && atomic_add_return(1, >pmcount) == 1) || (!on && atomic_dec_and_test(>pmcount))) { + rv = usb_autopm_get_interface(usbnet_dev->intf); + if (rv < 0) + goto err; + usbnet_dev->intf->needs_remote_wakeup = on; + usb_autopm_put_interface(usbnet_dev->intf); + } +err: + return rv; +} + +static int huawei_cdc_ncm_wdm_manage_power(struct usb_interface *intf, int status) +{ + struct usbnet *usbnet_dev = usb_get_intfdata(intf); + + /* can be called while disconnecting */ + if (!usbnet_dev) + return 0; + + return huawei_cdc_ncm_manage_power(usbnet_dev, status); +} + + +static int huawei_cdc_ncm_bind(struct usbnet *usbnet_dev, struct usb_interface *intf) +{ + struct cdc_ncm_ctx *ctx; + struct usb_driver *subdriver = ERR_PTR(-ENODEV); + int ret = -ENODEV; + struct huawei_cdc_ncm_state *drvstate = (void *)_dev->data; + + ret = cdc_ncm_bind_common(usbnet_dev, intf, 1); /* altsetting should be 1 for NCM devices */ + if (ret) + goto err; + + ctx = drvstate->ctx; + + if (usbnet_dev->status) + subdriver = usb_cdc_wdm_register(ctx->control, +_dev->status->desc, +256, /* CDC-WMC r1.1 requires wMaxCommand to be "at least 256 decimal (0x100)" */ + huaw
[PATCH RESEND V3 net-next 0/3] huawei_cdc_ncm driver introduction
These patches are all related to the new huawei_cdc_ncm driver, supporting devices that use the NCM protocol as a transport layer for other protocols. this is the case of the Huawei E3131 3G modem. In this version - I actually added the driver file! :) I don't know how I ended up forgetting about it, I should have learned git usage better after all this time! Sorry for the time I wasted you. Enrico Mioso (3): net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver net: cdc_ncm: remove non-standard NCM device IDs drivers/net/usb/Kconfig | 11 ++ drivers/net/usb/Makefile |1 + drivers/net/usb/cdc_ncm.c| 17 +-- drivers/net/usb/huawei_cdc_ncm.c | 210 ++ include/linux/usb/cdc_ncm.h |3 + 5 files changed, 229 insertions(+), 13 deletions(-) create mode 100644 drivers/net/usb/huawei_cdc_ncm.c -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND V3 net-next 2/3] net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver
This driver supports devices using the NCM protocol as an encapsulation layer for other protocols, like the E3131 Huawei 3G modem. This drivers approach was heavily inspired by the qmi_wwan approach code model. Suggested-by: Bjorn Mork bj...@mork.no Signed-off-by: Enrico Mioso mrkiko...@gmail.com --- drivers/net/usb/Kconfig | 11 ++ drivers/net/usb/Makefile |1 + drivers/net/usb/huawei_cdc_ncm.c | 210 ++ 3 files changed, 222 insertions(+) create mode 100644 drivers/net/usb/huawei_cdc_ncm.c diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index d84bfd4..6e56751 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig @@ -242,6 +242,17 @@ config USB_NET_CDC_NCM * ST-Ericsson M343 HSPA Mobile Broadband Modem (reference design) * Ericsson F5521gw Mobile Broadband Module +config USB_NET_HUAWEI_CDC_NCM + tristate Huawei-style CDC NCM support + depends on USB_USBNET + select USB_WDM + select USB_NET_CDC_NCM + help + This driver aims to support huawei-style NCM devices, that use ncm as a + transport for other protocols. + To compile this driver as a module, choose M here: the module will be + called huawei_cdc_ncm. + config USB_NET_CDC_MBIM tristate CDC MBIM support depends on USB_USBNET diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile index e817178..fd0e6a7 100644 --- a/drivers/net/usb/Makefile +++ b/drivers/net/usb/Makefile @@ -31,6 +31,7 @@ obj-$(CONFIG_USB_IPHETH) += ipheth.o obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o +obj-$(CONFIG_USB_NET_HUAWEI_CDC_NCM) += huawei_cdc_ncm.o obj-$(CONFIG_USB_VL600)+= lg-vl600.o obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o diff --git a/drivers/net/usb/huawei_cdc_ncm.c b/drivers/net/usb/huawei_cdc_ncm.c new file mode 100644 index 000..d3426b9 --- /dev/null +++ b/drivers/net/usb/huawei_cdc_ncm.c @@ -0,0 +1,210 @@ +/* + * huawei_cdc_ncm.c - handles huawei-style NCM devices. + * Copyright (C) 2013 Enrico Mioso mrkiko...@gmail.com + * This driver handles devices resembling the CDC NCM standard, but + * encapsulating another protocol inside it. An example are some Huawei 3G + * devices, exposing an embedded AT channel where you can set up the NCM + * connection. + * This code has been heavily inspired by the cdc_mbim.c driver, which is + * Copyright (c) 2012 Smith Micro Software, Inc. + * Copyright (c) 2012 Bjørn Mork bj...@mork.no + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + */ + +#include linux/module.h +#include linux/netdevice.h +#include linux/ethtool.h +#include linux/if_vlan.h +#include linux/ip.h +#include linux/mii.h +#include linux/usb.h +#include linux/usb/cdc.h +#include linux/usb/usbnet.h +#include linux/usb/cdc-wdm.h +#include linux/usb/cdc_ncm.h + +/* Driver data */ +struct huawei_cdc_ncm_state { + struct cdc_ncm_ctx *ctx; + atomic_t pmcount; + struct usb_driver *subdriver; + struct usb_interface *control; + struct usb_interface *data; +}; + +static int huawei_cdc_ncm_manage_power(struct usbnet *usbnet_dev, int on) +{ + struct huawei_cdc_ncm_state *drvstate = (void *)usbnet_dev-data; + int rv = 0; + + if ((on atomic_add_return(1, drvstate-pmcount) == 1) || (!on atomic_dec_and_test(drvstate-pmcount))) { + rv = usb_autopm_get_interface(usbnet_dev-intf); + if (rv 0) + goto err; + usbnet_dev-intf-needs_remote_wakeup = on; + usb_autopm_put_interface(usbnet_dev-intf); + } +err: + return rv; +} + +static int huawei_cdc_ncm_wdm_manage_power(struct usb_interface *intf, int status) +{ + struct usbnet *usbnet_dev = usb_get_intfdata(intf); + + /* can be called while disconnecting */ + if (!usbnet_dev) + return 0; + + return huawei_cdc_ncm_manage_power(usbnet_dev, status); +} + + +static int huawei_cdc_ncm_bind(struct usbnet *usbnet_dev, struct usb_interface *intf) +{ + struct cdc_ncm_ctx *ctx; + struct usb_driver *subdriver = ERR_PTR(-ENODEV); + int ret = -ENODEV; + struct huawei_cdc_ncm_state *drvstate = (void *)usbnet_dev-data; + + ret = cdc_ncm_bind_common(usbnet_dev, intf, 1); /* altsetting should be 1 for NCM devices */ + if (ret) + goto err; + + ctx = drvstate-ctx; + + if (usbnet_dev-status) + subdriver = usb_cdc_wdm_register(ctx-control, +usbnet_dev-status-desc
[PATCH RESEND V3 net-next 1/3] net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use
Some drivers implementing NCM-like protocols, may re-use those functions, as is the case in the huawei_cdc_ncm driver. Export them via EXPORT_SYMBOL_GPL, in accordance with how other functions have been exported. Signed-off-by: Enrico Mioso mrkiko...@gmail.com --- drivers/net/usb/cdc_ncm.c |6 -- include/linux/usb/cdc_ncm.h |3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 43afde8..62686be 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -858,7 +858,7 @@ static void cdc_ncm_txpath_bh(unsigned long param) } } -static struct sk_buff * +struct sk_buff * cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) { struct sk_buff *skb_out; @@ -885,6 +885,7 @@ error: return NULL; } +EXPORT_SYMBOL_GPL(cdc_ncm_tx_fixup); /* verify NTB header and return offset of first NDP, or negative error */ int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in) @@ -965,7 +966,7 @@ error: } EXPORT_SYMBOL_GPL(cdc_ncm_rx_verify_ndp16); -static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) { struct sk_buff *skb; struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev-data[0]; @@ -1040,6 +1041,7 @@ err_ndp: error: return 0; } +EXPORT_SYMBOL_GPL(cdc_ncm_rx_fixup); static void cdc_ncm_speed_change(struct cdc_ncm_ctx *ctx, diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index cc25b70..163244b 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h @@ -133,3 +133,6 @@ extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in); extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset); +struct sk_buff * +cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags); +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in); -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND V3 net-next 3/3] net: cdc_ncm: remove non-standard NCM device IDs
Remove device IDs of NCM-like (but not NCM-conformant) devices, that are handled by the huawwei_cdc_ncm driver now. Signed-off-by: Enrico Mioso mrkiko...@gmail.com --- drivers/net/usb/cdc_ncm.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 62686be..31f43f7 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -1236,17 +1236,6 @@ static const struct usb_device_id cdc_devs[] = { .driver_info = (unsigned long)wwan_info, }, - /* Huawei NCM devices disguised as vendor specific */ - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x16), - .driver_info = (unsigned long)wwan_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46), - .driver_info = (unsigned long)wwan_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76), - .driver_info = (unsigned long)wwan_info, - }, - /* Infineon(now Intel) HSPA Modem platform */ { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443, USB_CLASS_COMM, -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND net-next V2 1/3] net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use
Some drivers implementing NCM-like protocols, may re-use those functions, as is the case in the huawei_cdc_ncm driver. Export them via EXPORT_SYMBOL_GPL, in accordance with how other functions have been exported. Signed-off-by: Enrico Mioso --- drivers/net/usb/cdc_ncm.c |6 -- include/linux/usb/cdc_ncm.h |3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 43afde8..62686be 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -858,7 +858,7 @@ static void cdc_ncm_txpath_bh(unsigned long param) } } -static struct sk_buff * +struct sk_buff * cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) { struct sk_buff *skb_out; @@ -885,6 +885,7 @@ error: return NULL; } +EXPORT_SYMBOL_GPL(cdc_ncm_tx_fixup); /* verify NTB header and return offset of first NDP, or negative error */ int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in) @@ -965,7 +966,7 @@ error: } EXPORT_SYMBOL_GPL(cdc_ncm_rx_verify_ndp16); -static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) { struct sk_buff *skb; struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; @@ -1040,6 +1041,7 @@ err_ndp: error: return 0; } +EXPORT_SYMBOL_GPL(cdc_ncm_rx_fixup); static void cdc_ncm_speed_change(struct cdc_ncm_ctx *ctx, diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index cc25b70..163244b 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h @@ -133,3 +133,6 @@ extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in); extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset); +struct sk_buff * +cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags); +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND net-next V2 0/3] huawei_cdc_ncm introduction
These patches are all related to the new huawei_cdc_ncm driver, supporting devices that use the NCM protocol as a transport layer for other protocols. this is the case of the Huawei E3131 3G modem. Thanks should go to bjorn and others who helped me with patience. Enrico Mioso (3): net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use net: huawei_cdc_ncm: Introduce the net: cdc_ncm: remove non-standard NCM device IDs drivers/net/usb/Kconfig | 11 +++ drivers/net/usb/Makefile|1 + drivers/net/usb/cdc_ncm.c | 17 - include/linux/usb/cdc_ncm.h |3 +++ 4 files changed, 19 insertions(+), 13 deletions(-) -- This version includes mainly cosmetic fixes related to patches. 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND net-next V2 3/3] net: cdc_ncm: remove non-standard NCM device IDs
Remove device IDs of NCM-like (but not NCM-conformant) devices, that are handled by the huawwei_cdc_ncm driver now. Signed-off-by: Enrico Mioso --- drivers/net/usb/cdc_ncm.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 62686be..31f43f7 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -1236,17 +1236,6 @@ static const struct usb_device_id cdc_devs[] = { .driver_info = (unsigned long)_info, }, - /* Huawei NCM devices disguised as vendor specific */ - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x16), - .driver_info = (unsigned long)_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46), - .driver_info = (unsigned long)_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76), - .driver_info = (unsigned long)_info, - }, - /* Infineon(now Intel) HSPA Modem platform */ { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443, USB_CLASS_COMM, -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND net-next V2 2/3] net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver
This driver supports devices using the NCM protocol as an encapsulation layer for other protocols, like the E3131 Huawei 3G modem. This driver was heavily inspired by the qmi_wwan approach & code model. Suggested-by: Bjorn Mork Signed-off-by: Enrico Mioso --- drivers/net/usb/Kconfig | 11 +++ drivers/net/usb/Makefile |1 + 2 files changed, 12 insertions(+) diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index d84bfd4..6e56751 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig @@ -242,6 +242,17 @@ config USB_NET_CDC_NCM * ST-Ericsson M343 HSPA Mobile Broadband Modem (reference design) * Ericsson F5521gw Mobile Broadband Module +config USB_NET_HUAWEI_CDC_NCM + tristate "Huawei-style CDC NCM support" + depends on USB_USBNET + select USB_WDM + select USB_NET_CDC_NCM + help + This driver aims to support huawei-style NCM devices, that use ncm as a + transport for other protocols. + To compile this driver as a module, choose M here: the module will be + called huawei_cdc_ncm. + config USB_NET_CDC_MBIM tristate "CDC MBIM support" depends on USB_USBNET diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile index e817178..fd0e6a7 100644 --- a/drivers/net/usb/Makefile +++ b/drivers/net/usb/Makefile @@ -31,6 +31,7 @@ obj-$(CONFIG_USB_IPHETH) += ipheth.o obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o +obj-$(CONFIG_USB_NET_HUAWEI_CDC_NCM) += huawei_cdc_ncm.o obj-$(CONFIG_USB_VL600)+= lg-vl600.o obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND net-next V2 2/3] net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver
This driver supports devices using the NCM protocol as an encapsulation layer for other protocols, like the E3131 Huawei 3G modem. This driver was heavily inspired by the qmi_wwan approach code model. Suggested-by: Bjorn Mork bj...@mork.no Signed-off-by: Enrico Mioso mrkiko...@gmail.com --- drivers/net/usb/Kconfig | 11 +++ drivers/net/usb/Makefile |1 + 2 files changed, 12 insertions(+) diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index d84bfd4..6e56751 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig @@ -242,6 +242,17 @@ config USB_NET_CDC_NCM * ST-Ericsson M343 HSPA Mobile Broadband Modem (reference design) * Ericsson F5521gw Mobile Broadband Module +config USB_NET_HUAWEI_CDC_NCM + tristate Huawei-style CDC NCM support + depends on USB_USBNET + select USB_WDM + select USB_NET_CDC_NCM + help + This driver aims to support huawei-style NCM devices, that use ncm as a + transport for other protocols. + To compile this driver as a module, choose M here: the module will be + called huawei_cdc_ncm. + config USB_NET_CDC_MBIM tristate CDC MBIM support depends on USB_USBNET diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile index e817178..fd0e6a7 100644 --- a/drivers/net/usb/Makefile +++ b/drivers/net/usb/Makefile @@ -31,6 +31,7 @@ obj-$(CONFIG_USB_IPHETH) += ipheth.o obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o +obj-$(CONFIG_USB_NET_HUAWEI_CDC_NCM) += huawei_cdc_ncm.o obj-$(CONFIG_USB_VL600)+= lg-vl600.o obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND net-next V2 3/3] net: cdc_ncm: remove non-standard NCM device IDs
Remove device IDs of NCM-like (but not NCM-conformant) devices, that are handled by the huawwei_cdc_ncm driver now. Signed-off-by: Enrico Mioso mrkiko...@gmail.com --- drivers/net/usb/cdc_ncm.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 62686be..31f43f7 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -1236,17 +1236,6 @@ static const struct usb_device_id cdc_devs[] = { .driver_info = (unsigned long)wwan_info, }, - /* Huawei NCM devices disguised as vendor specific */ - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x16), - .driver_info = (unsigned long)wwan_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46), - .driver_info = (unsigned long)wwan_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76), - .driver_info = (unsigned long)wwan_info, - }, - /* Infineon(now Intel) HSPA Modem platform */ { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443, USB_CLASS_COMM, -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND net-next V2 0/3] huawei_cdc_ncm introduction
These patches are all related to the new huawei_cdc_ncm driver, supporting devices that use the NCM protocol as a transport layer for other protocols. this is the case of the Huawei E3131 3G modem. Thanks should go to bjorn and others who helped me with patience. Enrico Mioso (3): net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use net: huawei_cdc_ncm: Introduce the net: cdc_ncm: remove non-standard NCM device IDs drivers/net/usb/Kconfig | 11 +++ drivers/net/usb/Makefile|1 + drivers/net/usb/cdc_ncm.c | 17 - include/linux/usb/cdc_ncm.h |3 +++ 4 files changed, 19 insertions(+), 13 deletions(-) -- This version includes mainly cosmetic fixes related to patches. 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND net-next V2 1/3] net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use
Some drivers implementing NCM-like protocols, may re-use those functions, as is the case in the huawei_cdc_ncm driver. Export them via EXPORT_SYMBOL_GPL, in accordance with how other functions have been exported. Signed-off-by: Enrico Mioso mrkiko...@gmail.com --- drivers/net/usb/cdc_ncm.c |6 -- include/linux/usb/cdc_ncm.h |3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 43afde8..62686be 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -858,7 +858,7 @@ static void cdc_ncm_txpath_bh(unsigned long param) } } -static struct sk_buff * +struct sk_buff * cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) { struct sk_buff *skb_out; @@ -885,6 +885,7 @@ error: return NULL; } +EXPORT_SYMBOL_GPL(cdc_ncm_tx_fixup); /* verify NTB header and return offset of first NDP, or negative error */ int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in) @@ -965,7 +966,7 @@ error: } EXPORT_SYMBOL_GPL(cdc_ncm_rx_verify_ndp16); -static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) { struct sk_buff *skb; struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev-data[0]; @@ -1040,6 +1041,7 @@ err_ndp: error: return 0; } +EXPORT_SYMBOL_GPL(cdc_ncm_rx_fixup); static void cdc_ncm_speed_change(struct cdc_ncm_ctx *ctx, diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index cc25b70..163244b 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h @@ -133,3 +133,6 @@ extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in); extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset); +struct sk_buff * +cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags); +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in); -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use
Yes, you're right. I'm sorry - this time I didn't apply numbering scheme to those 3 patches - yet they are consequential, but not depending on each other from a strict point of view. Thank you for your review Greg! On Fri, 16 Aug 2013, Greg Kroah-Hartman wrote: ==Date: Fri, 16 Aug 2013 06:49:07 -0700 ==From: Greg Kroah-Hartman ==To: Enrico Mioso ==Cc: Bj?rn Mork , linux-kernel@vger.kernel.org, ==linux-...@vger.kernel.org, net...@vger.kernel.org ==Subject: Re: [PATCH] net: cdc_ncm: Export cdc_ncm_{tx, ==rx}_fixup functions for re-use == ==On Fri, Aug 16, 2013 at 03:39:19PM +0200, Enrico Mioso wrote: ==> Some drivers implementing NCM-like protocols, may re-use those functions, as is ==> the case in the huawei_cdc_ncm driver. == ==Where is that driver at, I don't see it in the kernel tree. == ==> Export them via EXPORT_SYMBOL_GPL. == ==Normally we don't export symbols until code that actually uses the ==symbols lands in the tree at the same time. == ==thanks, == ==greg k-h == -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] net: cdc_ncm: remove non-standard NCM device IDs
Remove device IDs of NCM-like (but not NCM-conformant) devices, that are handled by the huawwei_cdc_ncm driver now. Signed-off-by: Enrico Mioso --- drivers/net/usb/cdc_ncm.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 62686be..31f43f7 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -1236,17 +1236,6 @@ static const struct usb_device_id cdc_devs[] = { .driver_info = (unsigned long)_info, }, - /* Huawei NCM devices disguised as vendor specific */ - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x16), - .driver_info = (unsigned long)_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46), - .driver_info = (unsigned long)_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76), - .driver_info = (unsigned long)_info, - }, - /* Infineon(now Intel) HSPA Modem platform */ { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443, USB_CLASS_COMM, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] net: huawei_cdc_ncm: Introduce new huawei_cdc_ncm driver
This driver supports devices using the NCM protocol as an encapsulation layer for other protocols, like the E3131 Huawei 3G modem. Suggested-by: Bjorn Mork Signed-off-by: Enrico Mioso --- drivers/net/usb/Kconfig | 11 ++ drivers/net/usb/Makefile |1 + drivers/net/usb/huawei_cdc_ncm.c | 210 ++ 3 files changed, 222 insertions(+) create mode 100644 drivers/net/usb/huawei_cdc_ncm.c diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index d84bfd4..6e56751 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig @@ -242,6 +242,17 @@ config USB_NET_CDC_NCM * ST-Ericsson M343 HSPA Mobile Broadband Modem (reference design) * Ericsson F5521gw Mobile Broadband Module +config USB_NET_HUAWEI_CDC_NCM + tristate "Huawei-style CDC NCM support" + depends on USB_USBNET + select USB_WDM + select USB_NET_CDC_NCM + help + This driver aims to support huawei-style NCM devices, that use ncm as a + transport for other protocols. + To compile this driver as a module, choose M here: the module will be + called huawei_cdc_ncm. + config USB_NET_CDC_MBIM tristate "CDC MBIM support" depends on USB_USBNET diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile index e817178..fd0e6a7 100644 --- a/drivers/net/usb/Makefile +++ b/drivers/net/usb/Makefile @@ -31,6 +31,7 @@ obj-$(CONFIG_USB_IPHETH) += ipheth.o obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o +obj-$(CONFIG_USB_NET_HUAWEI_CDC_NCM) += huawei_cdc_ncm.o obj-$(CONFIG_USB_VL600)+= lg-vl600.o obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o diff --git a/drivers/net/usb/huawei_cdc_ncm.c b/drivers/net/usb/huawei_cdc_ncm.c new file mode 100644 index 000..d3426b9 --- /dev/null +++ b/drivers/net/usb/huawei_cdc_ncm.c @@ -0,0 +1,210 @@ +/* + * huawei_cdc_ncm.c - handles huawei-style NCM devices. + * Copyright (C) 2013 Enrico Mioso + * This driver handles devices resembling the CDC NCM standard, but + * encapsulating another protocol inside it. An example are some Huawei 3G + * devices, exposing an embedded AT channel where you can set up the NCM + * connection. + * This code has been heavily inspired by the cdc_mbim.c driver, which is + * Copyright (c) 2012 Smith Micro Software, Inc. + * Copyright (c) 2012 Bj??rn Mork + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Driver data */ +struct huawei_cdc_ncm_state { + struct cdc_ncm_ctx *ctx; + atomic_t pmcount; + struct usb_driver *subdriver; + struct usb_interface *control; + struct usb_interface *data; +}; + +static int huawei_cdc_ncm_manage_power(struct usbnet *usbnet_dev, int on) +{ + struct huawei_cdc_ncm_state *drvstate = (void *)_dev->data; + int rv = 0; + + if ((on && atomic_add_return(1, >pmcount) == 1) || (!on && atomic_dec_and_test(>pmcount))) { + rv = usb_autopm_get_interface(usbnet_dev->intf); + if (rv < 0) + goto err; + usbnet_dev->intf->needs_remote_wakeup = on; + usb_autopm_put_interface(usbnet_dev->intf); + } +err: + return rv; +} + +static int huawei_cdc_ncm_wdm_manage_power(struct usb_interface *intf, int status) +{ + struct usbnet *usbnet_dev = usb_get_intfdata(intf); + + /* can be called while disconnecting */ + if (!usbnet_dev) + return 0; + + return huawei_cdc_ncm_manage_power(usbnet_dev, status); +} + + +static int huawei_cdc_ncm_bind(struct usbnet *usbnet_dev, struct usb_interface *intf) +{ + struct cdc_ncm_ctx *ctx; + struct usb_driver *subdriver = ERR_PTR(-ENODEV); + int ret = -ENODEV; + struct huawei_cdc_ncm_state *drvstate = (void *)_dev->data; + + ret = cdc_ncm_bind_common(usbnet_dev, intf, 1); /* altsetting should be 1 for NCM devices */ + if (ret) + goto err; + + ctx = drvstate->ctx; + + if (usbnet_dev->status) + subdriver = usb_cdc_wdm_register(ctx->control, +_dev->status->desc, +256, /* CDC-WMC r1.1 requires wMaxCommand to be "at least 256 decimal (0x100)" */ + huawei_cdc_ncm_wdm_manage_power); + if (IS_ERR(subdriver)) { + ret = PTR_ER
[PATCH] net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use
Some drivers implementing NCM-like protocols, may re-use those functions, as is the case in the huawei_cdc_ncm driver. Export them via EXPORT_SYMBOL_GPL. Signed-off-by: Enrico Mioso --- drivers/net/usb/cdc_ncm.c |6 -- include/linux/usb/cdc_ncm.h |3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 43afde8..62686be 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -858,7 +858,7 @@ static void cdc_ncm_txpath_bh(unsigned long param) } } -static struct sk_buff * +struct sk_buff * cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) { struct sk_buff *skb_out; @@ -885,6 +885,7 @@ error: return NULL; } +EXPORT_SYMBOL_GPL(cdc_ncm_tx_fixup); /* verify NTB header and return offset of first NDP, or negative error */ int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in) @@ -965,7 +966,7 @@ error: } EXPORT_SYMBOL_GPL(cdc_ncm_rx_verify_ndp16); -static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) { struct sk_buff *skb; struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; @@ -1040,6 +1041,7 @@ err_ndp: error: return 0; } +EXPORT_SYMBOL_GPL(cdc_ncm_rx_fixup); static void cdc_ncm_speed_change(struct cdc_ncm_ctx *ctx, diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index cc25b70..163244b 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h @@ -133,3 +133,6 @@ extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in); extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset); +struct sk_buff * +cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags); +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use
Some drivers implementing NCM-like protocols, may re-use those functions, as is the case in the huawei_cdc_ncm driver. Export them via EXPORT_SYMBOL_GPL. Signed-off-by: Enrico Mioso mrkiko...@gmail.com --- drivers/net/usb/cdc_ncm.c |6 -- include/linux/usb/cdc_ncm.h |3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 43afde8..62686be 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -858,7 +858,7 @@ static void cdc_ncm_txpath_bh(unsigned long param) } } -static struct sk_buff * +struct sk_buff * cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) { struct sk_buff *skb_out; @@ -885,6 +885,7 @@ error: return NULL; } +EXPORT_SYMBOL_GPL(cdc_ncm_tx_fixup); /* verify NTB header and return offset of first NDP, or negative error */ int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in) @@ -965,7 +966,7 @@ error: } EXPORT_SYMBOL_GPL(cdc_ncm_rx_verify_ndp16); -static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) { struct sk_buff *skb; struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev-data[0]; @@ -1040,6 +1041,7 @@ err_ndp: error: return 0; } +EXPORT_SYMBOL_GPL(cdc_ncm_rx_fixup); static void cdc_ncm_speed_change(struct cdc_ncm_ctx *ctx, diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index cc25b70..163244b 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h @@ -133,3 +133,6 @@ extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in); extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset); +struct sk_buff * +cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags); +int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in); -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] net: huawei_cdc_ncm: Introduce new huawei_cdc_ncm driver
This driver supports devices using the NCM protocol as an encapsulation layer for other protocols, like the E3131 Huawei 3G modem. Suggested-by: Bjorn Mork bj...@mork.no Signed-off-by: Enrico Mioso mrkiko...@gmail.com --- drivers/net/usb/Kconfig | 11 ++ drivers/net/usb/Makefile |1 + drivers/net/usb/huawei_cdc_ncm.c | 210 ++ 3 files changed, 222 insertions(+) create mode 100644 drivers/net/usb/huawei_cdc_ncm.c diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index d84bfd4..6e56751 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig @@ -242,6 +242,17 @@ config USB_NET_CDC_NCM * ST-Ericsson M343 HSPA Mobile Broadband Modem (reference design) * Ericsson F5521gw Mobile Broadband Module +config USB_NET_HUAWEI_CDC_NCM + tristate Huawei-style CDC NCM support + depends on USB_USBNET + select USB_WDM + select USB_NET_CDC_NCM + help + This driver aims to support huawei-style NCM devices, that use ncm as a + transport for other protocols. + To compile this driver as a module, choose M here: the module will be + called huawei_cdc_ncm. + config USB_NET_CDC_MBIM tristate CDC MBIM support depends on USB_USBNET diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile index e817178..fd0e6a7 100644 --- a/drivers/net/usb/Makefile +++ b/drivers/net/usb/Makefile @@ -31,6 +31,7 @@ obj-$(CONFIG_USB_IPHETH) += ipheth.o obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o +obj-$(CONFIG_USB_NET_HUAWEI_CDC_NCM) += huawei_cdc_ncm.o obj-$(CONFIG_USB_VL600)+= lg-vl600.o obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o diff --git a/drivers/net/usb/huawei_cdc_ncm.c b/drivers/net/usb/huawei_cdc_ncm.c new file mode 100644 index 000..d3426b9 --- /dev/null +++ b/drivers/net/usb/huawei_cdc_ncm.c @@ -0,0 +1,210 @@ +/* + * huawei_cdc_ncm.c - handles huawei-style NCM devices. + * Copyright (C) 2013 Enrico Mioso mrkiko...@gmail.com + * This driver handles devices resembling the CDC NCM standard, but + * encapsulating another protocol inside it. An example are some Huawei 3G + * devices, exposing an embedded AT channel where you can set up the NCM + * connection. + * This code has been heavily inspired by the cdc_mbim.c driver, which is + * Copyright (c) 2012 Smith Micro Software, Inc. + * Copyright (c) 2012 Bj??rn Mork bj...@mork.no + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + */ + +#include linux/module.h +#include linux/netdevice.h +#include linux/ethtool.h +#include linux/if_vlan.h +#include linux/ip.h +#include linux/mii.h +#include linux/usb.h +#include linux/usb/cdc.h +#include linux/usb/usbnet.h +#include linux/usb/cdc-wdm.h +#include linux/usb/cdc_ncm.h + +/* Driver data */ +struct huawei_cdc_ncm_state { + struct cdc_ncm_ctx *ctx; + atomic_t pmcount; + struct usb_driver *subdriver; + struct usb_interface *control; + struct usb_interface *data; +}; + +static int huawei_cdc_ncm_manage_power(struct usbnet *usbnet_dev, int on) +{ + struct huawei_cdc_ncm_state *drvstate = (void *)usbnet_dev-data; + int rv = 0; + + if ((on atomic_add_return(1, drvstate-pmcount) == 1) || (!on atomic_dec_and_test(drvstate-pmcount))) { + rv = usb_autopm_get_interface(usbnet_dev-intf); + if (rv 0) + goto err; + usbnet_dev-intf-needs_remote_wakeup = on; + usb_autopm_put_interface(usbnet_dev-intf); + } +err: + return rv; +} + +static int huawei_cdc_ncm_wdm_manage_power(struct usb_interface *intf, int status) +{ + struct usbnet *usbnet_dev = usb_get_intfdata(intf); + + /* can be called while disconnecting */ + if (!usbnet_dev) + return 0; + + return huawei_cdc_ncm_manage_power(usbnet_dev, status); +} + + +static int huawei_cdc_ncm_bind(struct usbnet *usbnet_dev, struct usb_interface *intf) +{ + struct cdc_ncm_ctx *ctx; + struct usb_driver *subdriver = ERR_PTR(-ENODEV); + int ret = -ENODEV; + struct huawei_cdc_ncm_state *drvstate = (void *)usbnet_dev-data; + + ret = cdc_ncm_bind_common(usbnet_dev, intf, 1); /* altsetting should be 1 for NCM devices */ + if (ret) + goto err; + + ctx = drvstate-ctx; + + if (usbnet_dev-status) + subdriver = usb_cdc_wdm_register(ctx-control, +usbnet_dev-status-desc, +256, /* CDC-WMC r1.1 requires wMaxCommand to be at least 256 decimal (0x100
[PATCH] net: cdc_ncm: remove non-standard NCM device IDs
Remove device IDs of NCM-like (but not NCM-conformant) devices, that are handled by the huawwei_cdc_ncm driver now. Signed-off-by: Enrico Mioso mrkiko...@gmail.com --- drivers/net/usb/cdc_ncm.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 62686be..31f43f7 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -1236,17 +1236,6 @@ static const struct usb_device_id cdc_devs[] = { .driver_info = (unsigned long)wwan_info, }, - /* Huawei NCM devices disguised as vendor specific */ - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x16), - .driver_info = (unsigned long)wwan_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46), - .driver_info = (unsigned long)wwan_info, - }, - { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76), - .driver_info = (unsigned long)wwan_info, - }, - /* Infineon(now Intel) HSPA Modem platform */ { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443, USB_CLASS_COMM, -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use
Yes, you're right. I'm sorry - this time I didn't apply numbering scheme to those 3 patches - yet they are consequential, but not depending on each other from a strict point of view. Thank you for your review Greg! On Fri, 16 Aug 2013, Greg Kroah-Hartman wrote: ==Date: Fri, 16 Aug 2013 06:49:07 -0700 ==From: Greg Kroah-Hartman gre...@linuxfoundation.org ==To: Enrico Mioso mrkiko...@gmail.com ==Cc: Bj?rn Mork bj...@mork.no, linux-kernel@vger.kernel.org, ==linux-...@vger.kernel.org, net...@vger.kernel.org ==Subject: Re: [PATCH] net: cdc_ncm: Export cdc_ncm_{tx, ==rx}_fixup functions for re-use == ==On Fri, Aug 16, 2013 at 03:39:19PM +0200, Enrico Mioso wrote: == Some drivers implementing NCM-like protocols, may re-use those functions, as is == the case in the huawei_cdc_ncm driver. == ==Where is that driver at, I don't see it in the kernel tree. == == Export them via EXPORT_SYMBOL_GPL. == ==Normally we don't export symbols until code that actually uses the ==symbols lands in the tree at the same time. == ==thanks, == ==greg k-h == -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/