Re: [PATCH 0/2] usb: chipidea: streamline regmap handling

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

 



On 12/06/2013 07:39 AM, Peter Chen wrote:
> On Thu, Dec 05, 2013 at 12:32:55PM +0100, Marc Kleine-Budde wrote:
>> Hello Peter,
>>
>> these patches are for your ci-for-usb-next branch. The repmap handling is
>> streamlined and the kernel shrinks by 706 bytes on i.MX28:
>>
>> add/remove: 0/0 grow/shrink: 0/30 up/down: 0/-706 (-706)
>> function                                     old     new   delta
>> hw_wait_reg                                  164     160      -4
>> hw_port_test_get                              24      20      -4
>> hw_ep_flush                                  132     128      -4
>> ep_enable                                    392     388      -4
>> ep_disable                                   252     248      -4
>> ci_otg_work                                  248     244      -4
>> ci_otg_role                                   24      20      -4
>> ci_hdrc_host_init                            148     144      -4
>> ci_hdrc_gadget_init                          736     732      -4
>> ci_handle_vbus_change                         92      88      -4
>> isr_setup_status_complete                    156     148      -8
>> hw_port_test_set                              64      56      -8
>> host_start                                   360     352      -8
>> ci_udc_pullup                                 84      76      -8
>> ci_hdrc_remove                               100      92      -8
>> ci_udc_wakeup                                172     160     -12
>> udc_id_switch_for_host                        76      60     -16
>> udc_id_switch_for_device                      80      64     -16
>> ci_hdrc_otg_destroy                           92      76     -16
>> ci_hdrc_enter_lpm                            204     188     -16
>> ci_irq                                       264     244     -20
>> hw_device_state                              120      96     -24
>> _ep_queue.isra                              1056    1028     -28
>> ci_regs_nolpm                                 76      19     -57
>> ci_regs_lpm                                   76      19     -57
>> hw_device_reset                              416     352     -64
>> ep_set_halt                                  500     436     -64
>> hw_alloc_regmap                              204     136     -68
>> ci_hdrc_probe                               1512    1444     -68
>> udc_irq                                     3236    3136    -100
>>
> 
> Hi Marc,
> 
> Thanks for doing that, would you explain more why the function
> code size can be smaller with your two patches?

In the functions one instruction (4 Bytes) is saved per register access.
When the array is embedded into the hw_bank there is one indirection less:

For example, the original code:
 870:	e591301c 	ldr	r3, [r1, #28]
 874:	e593302c 	ldr	r3, [r3, #44]	; 0x2c
 878:	e5932000 	ldr	r2, [r3]
 87c:	e5d13030 	ldrb	r3, [r1, #48]	; 0x30

With my first patch applied:
 7d8:	e5913048 	ldr	r3, [r1, #72]	; 0x48
 7dc:	e5932000 	ldr	r2, [r3]
 7e0:	e5d130b4 	ldrb	r3, [r1, #180]	; 0xb4

With the second patch applied, we save some mem in ci_regs_nolpm and
ci_regs_lpm, because an entry only takes 1 Byte instead of 4.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux