All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PATCH] USB patches for 2.6.30-git
@ 2009-06-16  5:13 Greg KH
       [not found] ` <1245129858-23818-12-git-send-email-gregkh@suse.de>
  0 siblings, 1 reply; 197+ messages in thread
From: Greg KH @ 2009-06-16  5:13 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb

Here is the big USB patch queue for your kernel tree.

Stuff in here:
  - USB 3.0 support!
  - various new drivers
  - utf-8 bugfixes and proper handling by the usb core now (that makes
    up the majority of the non-usb patches in the diffstat below)
  - USB power management work
  - USB core cleanups for debugging code and other minor stuff
  - various bugfixes that were too big to go into .30

All of the non-USB related patches (like the PCI core one which the USB
core needs) have been acked by the respective subsystem maintainer to be
sent through this tree.

Please pull from:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6.git/

All of these patches have been in the -next and -mm releases for a while.

The full patches will be sent to the linux-usb mailing list, if anyone
wants to see them.

thanks,

greg k-h

------------

 MAINTAINERS                                        |    6 +
 .../arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h |   50 +
 arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h    |  377 +++
 drivers/pci/pci.c                                  |    5 +
 drivers/staging/uc2322/aten2011.c                  |    4 +-
 drivers/usb/Kconfig                                |    1 +
 drivers/usb/Makefile                               |    1 +
 drivers/usb/class/cdc-acm.c                        |   71 +-
 drivers/usb/class/cdc-acm.h                        |    2 +
 drivers/usb/class/usbtmc.c                         |    6 +
 drivers/usb/core/Kconfig                           |   16 +-
 drivers/usb/core/Makefile                          |    4 +-
 drivers/usb/core/config.c                          |  192 ++-
 drivers/usb/core/driver.c                          |   56 +-
 drivers/usb/core/endpoint.c                        |  160 +-
 drivers/usb/core/hcd-pci.c                         |  244 +-
 drivers/usb/core/hcd.c                             |  220 ++-
 drivers/usb/core/hcd.h                             |   55 +-
 drivers/usb/core/hub.c                             |  134 +-
 drivers/usb/core/hub.h                             |    3 +
 drivers/usb/core/message.c                         |  194 +-
 drivers/usb/core/sysfs.c                           |   12 +-
 drivers/usb/core/urb.c                             |   12 +
 drivers/usb/core/usb.c                             |   76 +-
 drivers/usb/core/usb.h                             |   13 +-
 drivers/usb/gadget/Kconfig                         |   53 +-
 drivers/usb/gadget/Makefile                        |    8 +
 drivers/usb/gadget/at91_udc.c                      |    4 +-
 drivers/usb/gadget/atmel_usba_udc.c                |   20 +-
 drivers/usb/gadget/audio.c                         |  302 ++
 drivers/usb/gadget/ci13xxx_udc.c                   |    6 +-
 drivers/usb/gadget/f_audio.c                       |  707 ++++
 drivers/usb/gadget/f_rndis.c                       |    4 +-
 drivers/usb/gadget/file_storage.c                  |   93 +-
 drivers/usb/gadget/fsl_mx3_udc.c                   |   95 +
 .../usb/gadget/{fsl_usb2_udc.c => fsl_udc_core.c}  |   69 +-
 drivers/usb/gadget/fsl_usb2_udc.h                  |   18 +
 drivers/usb/gadget/gadget_chips.h                  |    8 +
 drivers/usb/gadget/goku_udc.c                      |    6 +-
 drivers/usb/gadget/imx_udc.c                       |   14 +-
 drivers/usb/gadget/inode.c                         |   14 +-
 drivers/usb/gadget/langwell_udc.c                  | 3373 ++++++++++++++++++++
 drivers/usb/gadget/langwell_udc.h                  |  228 ++
 drivers/usb/gadget/pxa27x_udc.c                    |   71 +-
 drivers/usb/gadget/pxa27x_udc.h                    |    2 +
 drivers/usb/gadget/s3c-hsotg.c                     | 3269 +++++++++++++++++++
 drivers/usb/gadget/u_audio.c                       |  319 ++
 drivers/usb/gadget/u_audio.h                       |   56 +
 drivers/usb/gadget/u_serial.c                      |    1 +
 drivers/usb/host/Kconfig                           |   20 +
 drivers/usb/host/Makefile                          |    2 +
 drivers/usb/host/ehci-au1xxx.c                     |    1 +
 drivers/usb/host/ehci-fsl.c                        |    1 +
 drivers/usb/host/ehci-hcd.c                        |   47 +-
 drivers/usb/host/ehci-hub.c                        |    4 +-
 drivers/usb/host/ehci-ixp4xx.c                     |    1 +
 drivers/usb/host/ehci-orion.c                      |    3 +-
 drivers/usb/host/ehci-pci.c                        |   27 +-
 drivers/usb/host/ehci-ppc-of.c                     |    1 +
 drivers/usb/host/ehci-ps3.c                        |    1 +
 drivers/usb/host/ehci-q.c                          |   19 +-
 drivers/usb/host/ehci-sched.c                      |    8 +-
 drivers/usb/host/ehci.h                            |    1 +
 drivers/usb/host/fhci-dbg.c                        |    2 +-
 drivers/usb/host/hwa-hc.c                          |   21 -
 drivers/usb/host/ohci-dbg.c                        |   31 +-
 drivers/usb/host/ohci-hcd.c                        |   38 +-
 drivers/usb/host/ohci-pci.c                        |   24 +-
 drivers/usb/host/pci-quirks.c                      |  123 +
 drivers/usb/host/r8a66597-hcd.c                    |   62 +-
 drivers/usb/host/r8a66597.h                        |   38 +-
 drivers/usb/host/uhci-hcd.c                        |   23 +-
 drivers/usb/host/uhci-q.c                          |    2 +-
 drivers/usb/host/xhci-dbg.c                        |  485 +++
 drivers/usb/host/xhci-ext-caps.h                   |  145 +
 drivers/usb/host/xhci-hcd.c                        | 1274 ++++++++
 drivers/usb/host/xhci-hub.c                        |  308 ++
 drivers/usb/host/xhci-mem.c                        |  769 +++++
 drivers/usb/host/xhci-pci.c                        |  166 +
 drivers/usb/host/xhci-ring.c                       | 1648 ++++++++++
 drivers/usb/host/xhci.h                            | 1157 +++++++
 drivers/usb/misc/sisusbvga/Kconfig                 |    2 +-
 drivers/usb/misc/usbtest.c                         |   39 +-
 drivers/usb/mon/mon_text.c                         |    2 +-
 drivers/usb/musb/Kconfig                           |    2 +
 drivers/usb/musb/blackfin.c                        |   11 +-
 drivers/usb/musb/cppi_dma.c                        |   34 +-
 drivers/usb/musb/cppi_dma.h                        |    6 +-
 drivers/usb/musb/davinci.c                         |   54 +-
 drivers/usb/musb/musb_core.c                       |  228 +-
 drivers/usb/musb/musb_core.h                       |   22 +-
 drivers/usb/musb/musb_gadget.c                     |   45 +-
 drivers/usb/musb/musb_gadget_ep0.c                 |   45 +-
 drivers/usb/musb/musb_host.c                       |  273 +-
 drivers/usb/musb/musb_host.h                       |    1 +
 drivers/usb/musb/musb_virthub.c                    |   35 +-
 drivers/usb/musb/omap2430.c                        |   71 +-
 drivers/usb/musb/tusb6010.c                        |   70 +-
 drivers/usb/otg/Kconfig                            |   14 +
 drivers/usb/otg/Makefile                           |    1 +
 drivers/usb/otg/langwell_otg.c                     | 1915 +++++++++++
 drivers/usb/otg/nop-usb-xceiv.c                    |   25 +-
 drivers/usb/otg/twl4030-usb.c                      |   28 +-
 drivers/usb/serial/aircable.c                      |    5 +-
 drivers/usb/serial/belkin_sa.c                     |    7 +-
 drivers/usb/serial/bus.c                           |   27 +-
 drivers/usb/serial/cp210x.c                        |    6 +-
 drivers/usb/serial/cyberjack.c                     |   20 +-
 drivers/usb/serial/cypress_m8.c                    |   11 +-
 drivers/usb/serial/digi_acceleport.c               |   20 +-
 drivers/usb/serial/empeg.c                         |    8 -
 drivers/usb/serial/ftdi_sio.c                      |  179 +-
 drivers/usb/serial/ftdi_sio.h                      |   13 +-
 drivers/usb/serial/garmin_gps.c                    |  214 +-
 drivers/usb/serial/generic.c                       |  186 +-
 drivers/usb/serial/io_edgeport.c                   |   29 +-
 drivers/usb/serial/io_tables.h                     |   12 +-
 drivers/usb/serial/io_ti.c                         |   22 +-
 drivers/usb/serial/ipaq.c                          |    7 -
 drivers/usb/serial/iuu_phoenix.c                   |    6 +-
 drivers/usb/serial/keyspan.c                       |   13 +-
 drivers/usb/serial/keyspan.h                       |   12 +-
 drivers/usb/serial/keyspan_pda.c                   |    4 +-
 drivers/usb/serial/kl5kusb105.c                    |   39 +-
 drivers/usb/serial/kobil_sct.c                     |   12 +-
 drivers/usb/serial/mct_u232.c                      |   13 +-
 drivers/usb/serial/mos7720.c                       |    9 +-
 drivers/usb/serial/mos7840.c                       |  358 ++-
 drivers/usb/serial/omninet.c                       |   19 +-
 drivers/usb/serial/opticon.c                       |   14 +-
 drivers/usb/serial/option.c                        |   41 +-
 drivers/usb/serial/oti6858.c                       |    7 +-
 drivers/usb/serial/pl2303.c                        |   10 +-
 drivers/usb/serial/sierra.c                        |  185 +-
 drivers/usb/serial/spcp8x5.c                       |    5 +-
 drivers/usb/serial/symbolserial.c                  |   14 +-
 drivers/usb/serial/ti_usb_3410_5052.c              |   10 +-
 drivers/usb/serial/usb-serial.c                    |   53 +-
 drivers/usb/serial/usb_debug.c                     |   41 +
 drivers/usb/serial/visor.c                         |   13 +-
 drivers/usb/serial/whiteheat.c                     |    6 +-
 drivers/usb/storage/initializers.c                 |   14 +-
 drivers/usb/storage/option_ms.c                    |  124 +-
 drivers/usb/storage/sierra_ms.c                    |    2 +-
 drivers/usb/storage/unusual_devs.h                 |    2 +-
 fs/befs/linuxvfs.c                                 |   20 +-
 fs/fat/dir.c                                       |   29 +-
 fs/fat/namei_vfat.c                                |    4 +-
 fs/isofs/joliet.c                                  |   36 +-
 fs/ncpfs/ncplib_kernel.c                           |    8 +-
 fs/nls/nls_base.c                                  |  166 +-
 fs/nls/nls_utf8.c                                  |   13 +-
 include/linux/nls.h                                |   35 +-
 include/linux/pci.h                                |    8 +
 include/linux/pci_ids.h                            |    1 +
 include/linux/usb.h                                |   34 +-
 include/linux/usb/audio.h                          |  265 ++-
 include/linux/usb/ch9.h                            |   17 +
 include/linux/usb/composite.h                      |    3 +
 include/linux/usb/langwell_otg.h                   |  177 +
 include/linux/usb/langwell_udc.h                   |  310 ++
 include/linux/usb/otg.h                            |    4 +-
 include/linux/usb/r8a66597.h                       |   44 +
 include/linux/usb/serial.h                         |   32 +-
 164 files changed, 20947 insertions(+), 2080 deletions(-)
 create mode 100644 arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 create mode 100644 arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h
 create mode 100644 drivers/usb/gadget/audio.c
 create mode 100644 drivers/usb/gadget/f_audio.c
 create mode 100644 drivers/usb/gadget/fsl_mx3_udc.c
 rename drivers/usb/gadget/{fsl_usb2_udc.c => fsl_udc_core.c} (99%)
 create mode 100644 drivers/usb/gadget/langwell_udc.c
 create mode 100644 drivers/usb/gadget/langwell_udc.h
 create mode 100644 drivers/usb/gadget/s3c-hsotg.c
 create mode 100644 drivers/usb/gadget/u_audio.c
 create mode 100644 drivers/usb/gadget/u_audio.h
 create mode 100644 drivers/usb/host/xhci-dbg.c
 create mode 100644 drivers/usb/host/xhci-ext-caps.h
 create mode 100644 drivers/usb/host/xhci-hcd.c
 create mode 100644 drivers/usb/host/xhci-hub.c
 create mode 100644 drivers/usb/host/xhci-mem.c
 create mode 100644 drivers/usb/host/xhci-pci.c
 create mode 100644 drivers/usb/host/xhci-ring.c
 create mode 100644 drivers/usb/host/xhci.h
 create mode 100644 drivers/usb/otg/langwell_otg.c
 create mode 100644 include/linux/usb/langwell_otg.h
 create mode 100644 include/linux/usb/langwell_udc.h
 create mode 100644 include/linux/usb/r8a66597.h

---------------

Ajay Kumar Gupta (1):
      musb: add high bandwidth ISO support

Alan Stern (11):
      USB: consolidate usb_unbind_interface and usb_driver_release_interface
      NLS: update handling of Unicode
      USB: g_file_storage: use the "unaligned" accessors
      PCI: add power-state name strings
      USB: move PCI host controllers to new PM framework
      USB: new flag for resume-from-hibernation
      USB: usb-storage: fix return values from init functions
      USB: EHCI: stagger frames for interrupt transfers
      USB: EHCI: update toggle state for linked QHs
      USB: usb-serial: call port_probe and port_remove at the right times
      USB: usb-serial: replace shutdown with disconnect, release

Anand Gadiyar (1):
      musb: use dma mode 1 for TX if transfer size equals maxpacket (v2)

Andrew Morton (1):
      + drivers-usb-serial-sierrac-fix-printk-warning.patch added to -mm tree

Ben Dooks (1):
      USB: Gadget driver for Samsung HS/OtG block

Bryan Wu (3):
      usb: misc: SiS usbvga dangle: accept MUSB_HDRC as a fast enough host controller
      USB: audio: add USB audio class definitions
      USB: gadget: add USB Audio Gadget driver

Clemens Ladisch (3):
      nls: utf8_wcstombs: use correct buffer size in error case
      nls: utf8_wcstombs: fix buffer overflow
      usb: return device strings in UTF-8

Daniel Glöckner (2):
      USB: gadget: g_serial: append zlp when tx buffer becomes empty
      USB: gadget: imx_udc: don't queue more data when zlp is to be sent

Daniel Mack (1):
      USB: imx_udc: fix leak in imx_ep_alloc_request()

Daniel Suchy (1):
      USB: FTDI-SIO new device ids

David Brownell (7):
      USB: twl4030-usb: fix minor reporting goofage
      USB: nop-usb-xceiv: behave when linked as a module
      musb: proper hookup to transceiver drivers
      musb: otg timer cleanup
      musb: make initial HNP roleswitch work (v2)
      musb: support disconnect after HNP roleswitch
      USB: pxa27x_udc: introduce pxa27x_clear_otgph()

Elina Pasheva (7):
      USB: serial: sierra driver performance improvements
      USB: serial: sierra driver debug info visibility improvement
      USB: serial: sierra driver write path improvements
      USB: serial: sierra driver read path bug fix
      USB: serial: sierra driver zero length packet fix
      USB: serial: sierra driver interrupt urb resubmit fix
      USB: serial: sierra driver sierra_calc_num_ports() fix

FUJITA Tomonori (1):
      USB: replace dma_sync_single and dma_sync_sg with dma_sync_single_for_cpu and dma_sync_sg_for_cpu

Frans Pop (1):
      USB: Avoid PM error messages during resume if a device was disconnected

Greg Kroah-Hartman (13):
      USB: add usb debugfs directory
      USB: EHCI: use the new usb debugfs directory
      USB: FHCI: use the new usb debugfs directory
      USB: OHCI: use the new usb debugfs directory
      USB: UHCI: use the new usb debugfs directory
      USB: usbmon: use the new usb debugfs directory
      USB: add the usbfs devices file to debugfs
      USB: OHCI: use the ohci structure directly in debugfs files.
      USB: EHCI: create sysfs companion files directly in the controller device
      USB: remove unused usb_host class
      USB: usbtmc: fix switch statment
      USB: xhci: fix lots of compiler warnings.
      USB: xhci: fix some compiler warnings in xhci.h

Guennadi Liakhovetski (1):
      USB: gadget: Add i.MX3x support to the fsl_usb2_udc driver

H Hartley Sweeten (3):
      USB: core/sysfs: fix sparse warnings
      USB: host/ohci-hcd.c: fix sparse warnings
      USB: hub.c: fix sparse warnings

Hao Wu (1):
      USB: Add Intel Langwell USB OTG Transceiver Drive

Hermann Kneissel (1):
      USB: garmin_gps: removes usb_reset_device from garmin_close

Jason Wessel (6):
      USB: usb_debug, usb_generic_serial: implement multi urb write
      USB: serial: ftd_sio usb: move status check
      USB: serial: usb_debug,usb_generic_serial: implement sysrq and serial break
      USB: serial: ftd_sio: implement sysrq handling on break
      USB: pl2303 usb_serial: implement sysrq handling on break
      USB: usb_serial: only allow sysrq on a console port

Josua Dietze (1):
      USB: usb-storage: add filter to "option_ms" to leave unrecognized devices alone

Kay Sievers (1):
      usb: convert endpoint devices to bus-less childs of the usb interface

Kir Kolyshkin (1):
      USB: cdc-acm: quirk for Alcatel OT-I650

Mark Adamson (2):
      USB: serial: FTDI: add high speed device support
      USB: ftdi_sio: fix hi-speed device packet size calculation

Martin Fuzzey (1):
      USB: usbtest fix endless loop in unlink tests.

Matthias Kaehlcke (6):
      USB: ci13xxx_udc: use helper functions to determine endpoint type and direction
      USB: atmel_usba_udc: use helper functions to determine endpoint type and direction
      USB: at91_udc: use helper functions to determine endpoint type and direction
      USB: Goku-S: use helper functions to determine endpoint type and direction
      USB: gadgetfs: use helper functions to determine endpoint type and direction
      USB: UHCI queue: use usb_endpoint_type()

Maulik Mankad (1):
      USB: gadget : Fix RNDIS code to pass USB Compliance tests (USBCV) with g_ether

Michele Valzelli (1):
      USB: option.c: add Toshiba 3G HSDPA SM-Bus Minicard device id

Nicolas Ferre (1):
      USB: atmel_usba_udc: change way of specifying bias function

Niilo Minkkinen (1):
      usb: musb: disable OTG AUTOIDLE only with omap3430

Oliver Neukum (1):
      USB: support for cdc-acm of single interface devices

Pascal Terjan (1):
      USB: Ignore storage device in modem mode on DWN-652

Paul Mundt (2):
      wusb: hwa-hc: Drop unused pci_suspend/resume hooks.
      USB: xhci depends on PCI.

Pete Zaitcev (1):
      USB: janitor storage initializers

Randy Dunlap (2):
      USB: composite.h: mark private struct members as private:
      USB: usb.h: change private: kernel-doc for new format requirement

Richard Laager (1):
      USB: Identify Novatel MC760 in option driver

Robert Jarzmik (2):
      USB: pxa27x_udc: compatibility with pxa320 SoC
      USB: pxa27x_udc: single-thread setup requests

Sarah Sharp (34):
      USB: xhci: Support xHCI host controllers and USB 3.0 devices.
      USB: xhci: BIOS handoff and HW initialization.
      USB: xhci: Ring allocation and initialization.
      USB: xhci: Device context array allocation.
      USB: xhci: No-op command queueing and irq handler.
      USB: Add SuperSpeed to the list of USB device speeds.
      USB: Add USB 3.0 roothub support to USB core.
      USB: Don't reset USB 3.0 devices on port change detection.
      USB: Add route string to struct usb_device.
      USB: xhci: Root hub support.
      USB: Support for addressing a USB device under xHCI
      USB: xhci: Allocate and address USB devices
      USB: Support for submitting control URBs under xHCI.
      USB: xhci: Control transfer support.
      USB: Parse and store the SuperSpeed endpoint companion descriptors.
      USB: Support for bandwidth allocation.
      USB: xhci: Bandwidth allocation support
      USB: xhci: Bulk transfer support
      USB: Push scatter gather lists down to host controller drivers.
      USB: xhci: Scatter gather list support for bulk transfers.
      USB: xhci: URB cancellation support.
      USB: xhci: Fix register write order.
      USB: xhci: Fix Link TRB handoff bit twiddling.
      USB: xhci: Avoid global namespace pollution.
      USB: xhci: Clean up xhci_irq() function.
      USB: xhci: Avoid compiler reordering in Link TRB giveback.
      USB: Change names of SuperSpeed ep companion descriptor structs.
      USB: xhci: drop spinlock in xhci_urb_enqueue() error path.
      USB: xhci: Make xhci-mem.c include linux/dmapool.h
      usb; xhci: Fix TRB offset calculations.
      USB: xhci: Remove packed attribute from structures.
      USB: xHCI: Fix interrupt moderation.
      USB: xhci: Respect critical sections.
      USB: xhci: Add Makefile, MAINTAINERS, and Kconfig entries.

Scott James Remnant (1):
      USB: usbfs: deprecate and hide option for !embedded

Sergei Shtylyov (8):
      musb_gadget: fix unhandled endpoint 0 IRQs
      musb_gadget: suppress "parasitic" TX interrupts with CPPI
      musb_host: refactor musb_save_toggle() (take 2)
      musb_host: factor out musb_ep_{get|set}_qh()
      musb_host: simplify check for active URB
      musb_host: streamline musb_cleanup_urb() calls
      musb_host: refactor URB giveback
      musb: split out CPPI interrupt handler

Stephen Rothwell (1):
      USB: xhci: use xhci_handle_event instead of handle_event

Tony Cook (1):
      USB: mos7840: fix debug log messages

Uwe Kleine-König (3):
      USB: move twl4030_usb's probe function to .devinit.text
      USB: move r8a66597_hcd's probe function to .devinit.text
      USB: move orion-ehci's probe function to .devinit.text

Viral Mehta (1):
      USB: xhci: replace if-elseif-else with switch-case

Xiaochen Shen (1):
      USB: Add Intel Langwell USB Device Controller driver

Yoshihiro Shimoda (1):
      USB: r8a66597-hcd: use platform_data instead of module_param


^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 012/143] USB: move twl4030_usb's probe function to .devinit.text
       [not found] ` <1245129858-23818-12-git-send-email-gregkh@suse.de>
@ 2009-06-16  6:05   ` Uwe Kleine-König
  2009-06-16  6:20     ` Greg KH
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-06-16  6:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel

Hi Greg,

On Mon, Jun 15, 2009 at 10:22:07PM -0700, Greg Kroah-Hartman wrote:
> A pointer to twl4030_usb_probe is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.
I wonder if this kind of error could be detected automatically.  That is
at probe time check if the probe function is in the .init.text section.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 012/143] USB: move twl4030_usb's probe function to .devinit.text
  2009-06-16  6:05   ` [PATCH 012/143] USB: move twl4030_usb's probe function to .devinit.text Uwe Kleine-König
@ 2009-06-16  6:20     ` Greg KH
  2009-06-16  9:14       ` Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Greg KH @ 2009-06-16  6:20 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-kernel

On Tue, Jun 16, 2009 at 08:05:59AM +0200, Uwe Kleine-König wrote:
> Hi Greg,
> 
> On Mon, Jun 15, 2009 at 10:22:07PM -0700, Greg Kroah-Hartman wrote:
> > A pointer to twl4030_usb_probe is passed to the core via
> > platform_driver_register and so the function must not disappear when the
> > .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> > unbinding and binding a device to the driver via sysfs will result in an
> > oops as does a device being registered late.
> > 
> > An alternative to this patch is using platform_driver_probe instead of
> > platform_driver_register plus removing the pointer to the probe function
> > from the struct platform_driver.
> I wonder if this kind of error could be detected automatically.  That is
> at probe time check if the probe function is in the .init.text section.

There's nothing wrong with calling probe functions in the .init.text
section, _before_ we throw away the init.text section :)

So we would have to somehow know when that happens.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 012/143] USB: move twl4030_usb's probe function to .devinit.text
  2009-06-16  6:20     ` Greg KH
@ 2009-06-16  9:14       ` Uwe Kleine-König
  2009-06-16 16:21         ` Greg KH
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-06-16  9:14 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Hi Greg,

On Mon, Jun 15, 2009 at 11:20:35PM -0700, Greg KH wrote:
> On Tue, Jun 16, 2009 at 08:05:59AM +0200, Uwe Kleine-König wrote:
> > Hi Greg,
> > 
> > On Mon, Jun 15, 2009 at 10:22:07PM -0700, Greg Kroah-Hartman wrote:
> > > A pointer to twl4030_usb_probe is passed to the core via
> > > platform_driver_register and so the function must not disappear when the
> > > .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> > > unbinding and binding a device to the driver via sysfs will result in an
> > > oops as does a device being registered late.
> > > 
> > > An alternative to this patch is using platform_driver_probe instead of
> > > platform_driver_register plus removing the pointer to the probe function
> > > from the struct platform_driver.
> > I wonder if this kind of error could be detected automatically.  That is
> > at probe time check if the probe function is in the .init.text section.
> 
> There's nothing wrong with calling probe functions in the .init.text
> section, _before_ we throw away the init.text section :)
Ah, my fault:

I wonder if this kind of error could be detected automatically.  That is
at *register* time check if the probe function is in the .init.text
section.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 012/143] USB: move twl4030_usb's probe function to .devinit.text
  2009-06-16  9:14       ` Uwe Kleine-König
@ 2009-06-16 16:21         ` Greg KH
  2009-06-16 17:59           ` Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Greg KH @ 2009-06-16 16:21 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-kernel

On Tue, Jun 16, 2009 at 11:14:44AM +0200, Uwe Kleine-König wrote:
> Hi Greg,
> 
> On Mon, Jun 15, 2009 at 11:20:35PM -0700, Greg KH wrote:
> > On Tue, Jun 16, 2009 at 08:05:59AM +0200, Uwe Kleine-König wrote:
> > > Hi Greg,
> > > 
> > > On Mon, Jun 15, 2009 at 10:22:07PM -0700, Greg Kroah-Hartman wrote:
> > > > A pointer to twl4030_usb_probe is passed to the core via
> > > > platform_driver_register and so the function must not disappear when the
> > > > .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> > > > unbinding and binding a device to the driver via sysfs will result in an
> > > > oops as does a device being registered late.
> > > > 
> > > > An alternative to this patch is using platform_driver_probe instead of
> > > > platform_driver_register plus removing the pointer to the probe function
> > > > from the struct platform_driver.
> > > I wonder if this kind of error could be detected automatically.  That is
> > > at probe time check if the probe function is in the .init.text section.
> > 
> > There's nothing wrong with calling probe functions in the .init.text
> > section, _before_ we throw away the init.text section :)
> Ah, my fault:
> 
> I wonder if this kind of error could be detected automatically.  That is
> at *register* time check if the probe function is in the .init.text
> section.

But again, we can register devices with their probe functions in
.init.text and use them, before .init.text is thrown away, right?

So I don't see an easy way to check this and keep people from doing
stupid things...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 012/143] USB: move twl4030_usb's probe function to .devinit.text
  2009-06-16 16:21         ` Greg KH
@ 2009-06-16 17:59           ` Uwe Kleine-König
  2009-06-16 18:00             ` Greg KH
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-06-16 17:59 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Hello,

On Tue, Jun 16, 2009 at 09:21:06AM -0700, Greg KH wrote:
> On Tue, Jun 16, 2009 at 11:14:44AM +0200, Uwe Kleine-König wrote:
> > Hi Greg,
> > 
> > On Mon, Jun 15, 2009 at 11:20:35PM -0700, Greg KH wrote:
> > > On Tue, Jun 16, 2009 at 08:05:59AM +0200, Uwe Kleine-König wrote:
> > > > Hi Greg,
> > > > 
> > > > On Mon, Jun 15, 2009 at 10:22:07PM -0700, Greg Kroah-Hartman wrote:
> > > > > A pointer to twl4030_usb_probe is passed to the core via
> > > > > platform_driver_register and so the function must not disappear when the
> > > > > .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> > > > > unbinding and binding a device to the driver via sysfs will result in an
> > > > > oops as does a device being registered late.
> > > > > 
> > > > > An alternative to this patch is using platform_driver_probe instead of
> > > > > platform_driver_register plus removing the pointer to the probe function
> > > > > from the struct platform_driver.
> > > > I wonder if this kind of error could be detected automatically.  That is
> > > > at probe time check if the probe function is in the .init.text section.
> > > 
> > > There's nothing wrong with calling probe functions in the .init.text
> > > section, _before_ we throw away the init.text section :)
> > Ah, my fault:
> > 
> > I wonder if this kind of error could be detected automatically.  That is
> > at *register* time check if the probe function is in the .init.text
> > section.
> 
> But again, we can register devices with their probe functions in
> .init.text and use them, before .init.text is thrown away, right?
Yes, but only if you unregister the driver before .init.text is thrown
away, right?

If your driver is still active while .init.text already disappeared a new
device makes your kernel oops.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 012/143] USB: move twl4030_usb's probe function to .devinit.text
  2009-06-16 17:59           ` Uwe Kleine-König
@ 2009-06-16 18:00             ` Greg KH
  2009-06-16 18:23               ` Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Greg KH @ 2009-06-16 18:00 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-kernel

On Tue, Jun 16, 2009 at 07:59:00PM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> On Tue, Jun 16, 2009 at 09:21:06AM -0700, Greg KH wrote:
> > On Tue, Jun 16, 2009 at 11:14:44AM +0200, Uwe Kleine-König wrote:
> > > Hi Greg,
> > > 
> > > On Mon, Jun 15, 2009 at 11:20:35PM -0700, Greg KH wrote:
> > > > On Tue, Jun 16, 2009 at 08:05:59AM +0200, Uwe Kleine-König wrote:
> > > > > Hi Greg,
> > > > > 
> > > > > On Mon, Jun 15, 2009 at 10:22:07PM -0700, Greg Kroah-Hartman wrote:
> > > > > > A pointer to twl4030_usb_probe is passed to the core via
> > > > > > platform_driver_register and so the function must not disappear when the
> > > > > > .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> > > > > > unbinding and binding a device to the driver via sysfs will result in an
> > > > > > oops as does a device being registered late.
> > > > > > 
> > > > > > An alternative to this patch is using platform_driver_probe instead of
> > > > > > platform_driver_register plus removing the pointer to the probe function
> > > > > > from the struct platform_driver.
> > > > > I wonder if this kind of error could be detected automatically.  That is
> > > > > at probe time check if the probe function is in the .init.text section.
> > > > 
> > > > There's nothing wrong with calling probe functions in the .init.text
> > > > section, _before_ we throw away the init.text section :)
> > > Ah, my fault:
> > > 
> > > I wonder if this kind of error could be detected automatically.  That is
> > > at *register* time check if the probe function is in the .init.text
> > > section.
> > 
> > But again, we can register devices with their probe functions in
> > .init.text and use them, before .init.text is thrown away, right?
> Yes, but only if you unregister the driver before .init.text is thrown
> away, right?
> 
> If your driver is still active while .init.text already disappeared a new
> device makes your kernel oops.

Yes, but for almost all platform devices, they can not have a new device
appear after init runs, as they are fixed to the motherboard.

Anyway, if you want to send a patch to dynamically catch this kind of
problem, that would be great.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 012/143] USB: move twl4030_usb's probe function to .devinit.text
  2009-06-16 18:00             ` Greg KH
@ 2009-06-16 18:23               ` Uwe Kleine-König
  2009-06-19 13:42                 ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-06-16 18:23 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Hello,

On Tue, Jun 16, 2009 at 11:00:53AM -0700, Greg KH wrote:
> On Tue, Jun 16, 2009 at 07:59:00PM +0200, Uwe Kleine-König wrote:
> > Hello,
> > 
> > On Tue, Jun 16, 2009 at 09:21:06AM -0700, Greg KH wrote:
> > > On Tue, Jun 16, 2009 at 11:14:44AM +0200, Uwe Kleine-König wrote:
> > > > Hi Greg,
> > > > 
> > > > On Mon, Jun 15, 2009 at 11:20:35PM -0700, Greg KH wrote:
> > > > > On Tue, Jun 16, 2009 at 08:05:59AM +0200, Uwe Kleine-König wrote:
> > > > > > Hi Greg,
> > > > > > 
> > > > > > On Mon, Jun 15, 2009 at 10:22:07PM -0700, Greg Kroah-Hartman wrote:
> > > > > > > A pointer to twl4030_usb_probe is passed to the core via
> > > > > > > platform_driver_register and so the function must not disappear when the
> > > > > > > .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> > > > > > > unbinding and binding a device to the driver via sysfs will result in an
> > > > > > > oops as does a device being registered late.
> > > > > > > 
> > > > > > > An alternative to this patch is using platform_driver_probe instead of
> > > > > > > platform_driver_register plus removing the pointer to the probe function
> > > > > > > from the struct platform_driver.
> > > > > > I wonder if this kind of error could be detected automatically.  That is
> > > > > > at probe time check if the probe function is in the .init.text section.
> > > > > 
> > > > > There's nothing wrong with calling probe functions in the .init.text
> > > > > section, _before_ we throw away the init.text section :)
> > > > Ah, my fault:
> > > > 
> > > > I wonder if this kind of error could be detected automatically.  That is
> > > > at *register* time check if the probe function is in the .init.text
> > > > section.
> > > 
> > > But again, we can register devices with their probe functions in
> > > .init.text and use them, before .init.text is thrown away, right?
> > Yes, but only if you unregister the driver before .init.text is thrown
> > away, right?
> > 
> > If your driver is still active while .init.text already disappeared a new
> > device makes your kernel oops.
> 
> Yes, but for almost all platform devices, they can not have a new device
> appear after init runs, as they are fixed to the motherboard.
The same check could be implemented for drivers of the other bus types,
too.
 
> Anyway, if you want to send a patch to dynamically catch this kind of
> problem, that would be great.
I somehow feared that at one point someone wants a patch from me if I
ask if it's possible at all ... :-)

/me goes and searces if there is already a function to check if a
pointer points into .init.text.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-06-16 18:23               ` Uwe Kleine-König
@ 2009-06-19 13:42                 ` Uwe Kleine-König
  2009-06-19 14:11                   ` Greg KH
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-06-19 13:42 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/base/platform.c |   42 ++++++++++++++++++++++++++++++++++++------
 include/linux/kernel.h  |    2 ++
 include/linux/module.h  |   12 ++++++++++++
 kernel/extable.c        |   12 ++++++++++++
 kernel/module.c         |   36 ++++++++++++++++++++++++++++++++++++
 5 files changed, 98 insertions(+), 6 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 81cb01b..851ba84 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -470,11 +470,7 @@ static void platform_drv_shutdown(struct device *_dev)
 	drv->shutdown(dev);
 }
 
-/**
- * platform_driver_register
- * @drv: platform driver structure
- */
-int platform_driver_register(struct platform_driver *drv)
+static int __platform_driver_register(struct platform_driver *drv)
 {
 	drv->driver.bus = &platform_bus_type;
 	if (drv->probe)
@@ -489,6 +485,40 @@ int platform_driver_register(struct platform_driver *drv)
 
 	return driver_register(&drv->driver);
 }
+
+/**
+ * platform_driver_register
+ * @drv: platform driver structure
+ */
+int platform_driver_register(struct platform_driver *drv)
+{
+	int ret = __platform_driver_register(drv);
+
+#if defined(CONFIG_HOTPLUG)
+	/*
+	 * drivers that are registered by platform_driver_register
+	 * should not have their probe function in .init.text.  The
+	 * reason is that a probe can happen after .init.text is
+	 * discarded which then results in an oops.  The alternatives
+	 * are using .devinit.text for the probe function or "register"
+	 * with platform_driver_probe.
+	 */
+	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
+		pr_warning("oops-warning: probe function of platform driver %s"
+			       " lives in .init.text\n", drv->driver.name);
+#else
+	/*
+	 * without HOTPLUG probe functions can be discarded after the driver is
+	 * loaded.
+	 * There is a little chance for false positives, namely if the driver is
+	 * registered after the .init sections are discarded.
+	 */
+	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
+		pr_info("probably the probe function of platform driver %s can"
+				" be moved to .init.text\n", drv->driver.name);
+#endif
+	return ret;
+}
 EXPORT_SYMBOL_GPL(platform_driver_register);
 
 /**
@@ -525,7 +555,7 @@ int __init_or_module platform_driver_probe(struct platform_driver *drv,
 
 	/* temporary section violation during probe() */
 	drv->probe = probe;
-	retval = code = platform_driver_register(drv);
+	retval = code = __platform_driver_register(drv);
 
 	/* Fixup that section violation, being paranoid about code scanning
 	 * the list of drivers in order to probe new devices.  Check to see
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index c5a71c3..5db1817 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -203,8 +203,10 @@ extern char *get_options(const char *str, int nints, int *ints);
 extern unsigned long long memparse(const char *ptr, char **retptr);
 
 extern int core_kernel_text(unsigned long addr);
+extern int core_kernel_init_text(unsigned long addr)
 extern int __kernel_text_address(unsigned long addr);
 extern int kernel_text_address(unsigned long addr);
+extern int kernel_init_text_address(unsigned long addr);
 extern int func_ptr_is_kernel_text(void *ptr);
 
 struct pid;
diff --git a/include/linux/module.h b/include/linux/module.h
index 505f20d..ff07937 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -379,9 +379,11 @@ static inline int module_is_live(struct module *mod)
 }
 
 struct module *__module_text_address(unsigned long addr);
+struct module *__module_init_text_address(unsigned long addr);
 struct module *__module_address(unsigned long addr);
 bool is_module_address(unsigned long addr);
 bool is_module_text_address(unsigned long addr);
+bool is_module_init_text_address(unsigned long addr);
 
 static inline int within_module_core(unsigned long addr, struct module *mod)
 {
@@ -550,6 +552,11 @@ static inline struct module *__module_text_address(unsigned long addr)
 	return NULL;
 }
 
+static inline struct module *__module_init_text_address(unsigned long addr)
+{
+	return NULL;
+}
+
 static inline bool is_module_address(unsigned long addr)
 {
 	return false;
@@ -560,6 +567,11 @@ static inline bool is_module_text_address(unsigned long addr)
 	return false;
 }
 
+static inline bool is_module_init_text_address(unsigned long addr)
+{
+	return false;
+}
+
 /* Get/put a kernel symbol (calls should be symmetric) */
 #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
 #define symbol_put(x) do { } while(0)
diff --git a/kernel/extable.c b/kernel/extable.c
index 7f8f263..bfd7bda 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -66,6 +66,11 @@ int core_kernel_text(unsigned long addr)
 	    addr <= (unsigned long)_etext)
 		return 1;
 
+	return core_kernel_init_text;
+}
+
+int core_kernel_init_text(unsigned long addr)
+{
 	if (system_state == SYSTEM_BOOTING &&
 	    init_kernel_text(addr))
 		return 1;
@@ -98,6 +103,13 @@ int kernel_text_address(unsigned long addr)
 	return is_module_text_address(addr);
 }
 
+int kernel_init_text_address(unsigned long addr)
+{
+	if (core_kernel_init_text(addr))
+		return 1;
+	return is_module_init_text_address(addr);
+}
+
 /*
  * On some architectures (PPC64, IA64) function pointers
  * are actually only tokens to some data that then holds the
diff --git a/kernel/module.c b/kernel/module.c
index 215aaab..a637213 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2874,6 +2874,22 @@ bool is_module_text_address(unsigned long addr)
 }
 
 /*
+ * is_module_init_text_address - is this address inside a module's .init.text
+ * section?
+ * @addr: the address to check.
+ */
+bool is_module_init_text_address(unsigned long addr)
+{
+	bool ret;
+
+	preempt_disable();
+	ret = __module_init_text_address(addr) != NULL;
+	preempt_enable();
+
+	return ret;
+}
+
+/*
  * __module_text_address - get the module whose code contains an address.
  * @addr: the address.
  *
@@ -2893,6 +2909,26 @@ struct module *__module_text_address(unsigned long addr)
 }
 EXPORT_SYMBOL_GPL(__module_text_address);
 
+/*
+ * __module_init_text_address - get the module whose .init.text contains an
+ * address.
+ * @addr: the address.
+ *
+ * Must be called with preempt disabled or module mutex held so that
+ * module doesn't get freed during this.
+ */
+struct module *__module_init_text_address(unsigned long addr)
+{
+	struct module *mod = __module_address(addr);
+	if (mod) {
+		/* Make sure it's within the .init.text section. */
+		if (!within(addr, mod->module_init, mod->init_text_size))
+			mod = NULL;
+	}
+	return mod;
+}
+EXPORT_SYMBOL_GPL(__module_init_text_address);
+
 /* Don't grab lock, we're oopsing. */
 void print_modules(void)
 {
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-06-19 13:42                 ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
@ 2009-06-19 14:11                   ` Greg KH
  2009-06-19 14:43                     ` Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Greg KH @ 2009-06-19 14:11 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-kernel

On Fri, Jun 19, 2009 at 03:42:19PM +0200, Uwe Kleine-König wrote:
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/base/platform.c |   42 ++++++++++++++++++++++++++++++++++++------
>  include/linux/kernel.h  |    2 ++
>  include/linux/module.h  |   12 ++++++++++++
>  kernel/extable.c        |   12 ++++++++++++
>  kernel/module.c         |   36 ++++++++++++++++++++++++++++++++++++
>  5 files changed, 98 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 81cb01b..851ba84 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -470,11 +470,7 @@ static void platform_drv_shutdown(struct device *_dev)
>  	drv->shutdown(dev);
>  }
>  
> -/**
> - * platform_driver_register
> - * @drv: platform driver structure
> - */
> -int platform_driver_register(struct platform_driver *drv)
> +static int __platform_driver_register(struct platform_driver *drv)
>  {
>  	drv->driver.bus = &platform_bus_type;
>  	if (drv->probe)
> @@ -489,6 +485,40 @@ int platform_driver_register(struct platform_driver *drv)
>  
>  	return driver_register(&drv->driver);
>  }
> +
> +/**
> + * platform_driver_register
> + * @drv: platform driver structure
> + */
> +int platform_driver_register(struct platform_driver *drv)
> +{
> +	int ret = __platform_driver_register(drv);
> +
> +#if defined(CONFIG_HOTPLUG)
> +	/*
> +	 * drivers that are registered by platform_driver_register
> +	 * should not have their probe function in .init.text.  The
> +	 * reason is that a probe can happen after .init.text is
> +	 * discarded which then results in an oops.  The alternatives
> +	 * are using .devinit.text for the probe function or "register"
> +	 * with platform_driver_probe.
> +	 */

That's not true, remember, drivers built into the system, like platform
ones, can have their probe function in .init.text, as it will be called
before we discard .init.text, and will never be called again as the
device will never be "hot added" at any future time.

So this could trigger a lot of false positives :(

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-06-19 14:11                   ` Greg KH
@ 2009-06-19 14:43                     ` Uwe Kleine-König
  2009-06-29  7:55                       ` Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-06-19 14:43 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Hi Greg,

On Fri, Jun 19, 2009 at 07:11:28AM -0700, Greg KH wrote:
> On Fri, Jun 19, 2009 at 03:42:19PM +0200, Uwe Kleine-König wrote:
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> >  drivers/base/platform.c |   42 ++++++++++++++++++++++++++++++++++++------
> >  include/linux/kernel.h  |    2 ++
> >  include/linux/module.h  |   12 ++++++++++++
> >  kernel/extable.c        |   12 ++++++++++++
> >  kernel/module.c         |   36 ++++++++++++++++++++++++++++++++++++
> >  5 files changed, 98 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> > index 81cb01b..851ba84 100644
> > --- a/drivers/base/platform.c
> > +++ b/drivers/base/platform.c
> > @@ -470,11 +470,7 @@ static void platform_drv_shutdown(struct device *_dev)
> >  	drv->shutdown(dev);
> >  }
> >  
> > -/**
> > - * platform_driver_register
> > - * @drv: platform driver structure
> > - */
> > -int platform_driver_register(struct platform_driver *drv)
> > +static int __platform_driver_register(struct platform_driver *drv)
> >  {
> >  	drv->driver.bus = &platform_bus_type;
> >  	if (drv->probe)
> > @@ -489,6 +485,40 @@ int platform_driver_register(struct platform_driver *drv)
> >  
> >  	return driver_register(&drv->driver);
> >  }
> > +
> > +/**
> > + * platform_driver_register
> > + * @drv: platform driver structure
> > + */
> > +int platform_driver_register(struct platform_driver *drv)
> > +{
> > +	int ret = __platform_driver_register(drv);
> > +
> > +#if defined(CONFIG_HOTPLUG)
> > +	/*
> > +	 * drivers that are registered by platform_driver_register
> > +	 * should not have their probe function in .init.text.  The
> > +	 * reason is that a probe can happen after .init.text is
> > +	 * discarded which then results in an oops.  The alternatives
> > +	 * are using .devinit.text for the probe function or "register"
> > +	 * with platform_driver_probe.
> > +	 */
> 
> That's not true, remember, drivers built into the system, like platform
> ones, can have their probe function in .init.text, as it will be called
> before we discard .init.text, and will never be called again as the
> device will never be "hot added" at any future time.
> 
> So this could trigger a lot of false positives :(
IMHO this is not a false positive.  You can still do

	for f in unbind bind do echo $deviceid > /sys/bus/platform/drivers/$drivername/$f; done

This type of driver should use platform_driver_probe.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-06-19 14:43                     ` Uwe Kleine-König
@ 2009-06-29  7:55                       ` Uwe Kleine-König
  2009-07-11  3:34                         ` Greg KH
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-06-29  7:55 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Hi Greg,

On Fri, Jun 19, 2009 at 04:43:54PM +0200, Uwe Kleine-König wrote:
> On Fri, Jun 19, 2009 at 07:11:28AM -0700, Greg KH wrote:
> > On Fri, Jun 19, 2009 at 03:42:19PM +0200, Uwe Kleine-König wrote:
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > ---
> > >  drivers/base/platform.c |   42 ++++++++++++++++++++++++++++++++++++------
> > >  include/linux/kernel.h  |    2 ++
> > >  include/linux/module.h  |   12 ++++++++++++
> > >  kernel/extable.c        |   12 ++++++++++++
> > >  kernel/module.c         |   36 ++++++++++++++++++++++++++++++++++++
> > >  5 files changed, 98 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> > > index 81cb01b..851ba84 100644
> > > --- a/drivers/base/platform.c
> > > +++ b/drivers/base/platform.c
> > > @@ -470,11 +470,7 @@ static void platform_drv_shutdown(struct device *_dev)
> > >  	drv->shutdown(dev);
> > >  }
> > >  
> > > -/**
> > > - * platform_driver_register
> > > - * @drv: platform driver structure
> > > - */
> > > -int platform_driver_register(struct platform_driver *drv)
> > > +static int __platform_driver_register(struct platform_driver *drv)
> > >  {
> > >  	drv->driver.bus = &platform_bus_type;
> > >  	if (drv->probe)
> > > @@ -489,6 +485,40 @@ int platform_driver_register(struct platform_driver *drv)
> > >  
> > >  	return driver_register(&drv->driver);
> > >  }
> > > +
> > > +/**
> > > + * platform_driver_register
> > > + * @drv: platform driver structure
> > > + */
> > > +int platform_driver_register(struct platform_driver *drv)
> > > +{
> > > +	int ret = __platform_driver_register(drv);
> > > +
> > > +#if defined(CONFIG_HOTPLUG)
> > > +	/*
> > > +	 * drivers that are registered by platform_driver_register
> > > +	 * should not have their probe function in .init.text.  The
> > > +	 * reason is that a probe can happen after .init.text is
> > > +	 * discarded which then results in an oops.  The alternatives
> > > +	 * are using .devinit.text for the probe function or "register"
> > > +	 * with platform_driver_probe.
> > > +	 */
> > 
> > That's not true, remember, drivers built into the system, like platform
> > ones, can have their probe function in .init.text, as it will be called
> > before we discard .init.text, and will never be called again as the
> > device will never be "hot added" at any future time.
> > 
> > So this could trigger a lot of false positives :(
> IMHO this is not a false positive.  You can still do
> 
> 	for f in unbind bind do echo $deviceid > /sys/bus/platform/drivers/$drivername/$f; done
> 
> This type of driver should use platform_driver_probe.
Are you conviced and took the patch or did you give up to convince me?

I still think the patch is correct and I'd like to have it applied.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-06-29  7:55                       ` Uwe Kleine-König
@ 2009-07-11  3:34                         ` Greg KH
  2009-07-11 10:00                           ` Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Greg KH @ 2009-07-11  3:34 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-kernel

On Mon, Jun 29, 2009 at 09:55:35AM +0200, Uwe Kleine-König wrote:
> Hi Greg,
> 
> On Fri, Jun 19, 2009 at 04:43:54PM +0200, Uwe Kleine-König wrote:
> > On Fri, Jun 19, 2009 at 07:11:28AM -0700, Greg KH wrote:
> > > On Fri, Jun 19, 2009 at 03:42:19PM +0200, Uwe Kleine-König wrote:
> > > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > ---
> > > >  drivers/base/platform.c |   42 ++++++++++++++++++++++++++++++++++++------
> > > >  include/linux/kernel.h  |    2 ++
> > > >  include/linux/module.h  |   12 ++++++++++++
> > > >  kernel/extable.c        |   12 ++++++++++++
> > > >  kernel/module.c         |   36 ++++++++++++++++++++++++++++++++++++
> > > >  5 files changed, 98 insertions(+), 6 deletions(-)
> > > > 
> > > > diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> > > > index 81cb01b..851ba84 100644
> > > > --- a/drivers/base/platform.c
> > > > +++ b/drivers/base/platform.c
> > > > @@ -470,11 +470,7 @@ static void platform_drv_shutdown(struct device *_dev)
> > > >  	drv->shutdown(dev);
> > > >  }
> > > >  
> > > > -/**
> > > > - * platform_driver_register
> > > > - * @drv: platform driver structure
> > > > - */
> > > > -int platform_driver_register(struct platform_driver *drv)
> > > > +static int __platform_driver_register(struct platform_driver *drv)
> > > >  {
> > > >  	drv->driver.bus = &platform_bus_type;
> > > >  	if (drv->probe)
> > > > @@ -489,6 +485,40 @@ int platform_driver_register(struct platform_driver *drv)
> > > >  
> > > >  	return driver_register(&drv->driver);
> > > >  }
> > > > +
> > > > +/**
> > > > + * platform_driver_register
> > > > + * @drv: platform driver structure
> > > > + */
> > > > +int platform_driver_register(struct platform_driver *drv)
> > > > +{
> > > > +	int ret = __platform_driver_register(drv);
> > > > +
> > > > +#if defined(CONFIG_HOTPLUG)
> > > > +	/*
> > > > +	 * drivers that are registered by platform_driver_register
> > > > +	 * should not have their probe function in .init.text.  The
> > > > +	 * reason is that a probe can happen after .init.text is
> > > > +	 * discarded which then results in an oops.  The alternatives
> > > > +	 * are using .devinit.text for the probe function or "register"
> > > > +	 * with platform_driver_probe.
> > > > +	 */
> > > 
> > > That's not true, remember, drivers built into the system, like platform
> > > ones, can have their probe function in .init.text, as it will be called
> > > before we discard .init.text, and will never be called again as the
> > > device will never be "hot added" at any future time.
> > > 
> > > So this could trigger a lot of false positives :(
> > IMHO this is not a false positive.  You can still do
> > 
> > 	for f in unbind bind do echo $deviceid > /sys/bus/platform/drivers/$drivername/$f; done
> > 
> > This type of driver should use platform_driver_probe.
> Are you conviced and took the patch or did you give up to convince me?

Heh, no, sorry, it got burried in my queue.

> I still think the patch is correct and I'd like to have it applied.

Ok, let's test it out in the linux-next tree for a while to make sure it
works properly.  Care to send me an updated version?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-07-11  3:34                         ` Greg KH
@ 2009-07-11 10:00                           ` Uwe Kleine-König
  2009-07-11 17:05                             ` Greg KH
  2009-07-11 18:59                             ` Greg KH
  0 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 10:00 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Hi Greg,

> > Are you conviced and took the patch or did you give up to convince me?
> 
> Heh, no, sorry, it got burried in my queue.
> 
> > I still think the patch is correct and I'd like to have it applied.
> 
> Ok, let's test it out in the linux-next tree for a while to make sure it
> works properly.  Care to send me an updated version?
I updated to latest Linus' master.  It applies to linux-next from
Fri Jul 10 14:44:30 2009 +1000 as is.

Back some time I sent a series that fixes many of these bugs.  I will
update it later today and resend.

Best regards and thanks,
Uwe

---->8----
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Subject: [PATCH] platform_driver_register:  warn if probe is in .init.text

with HOTPLUG=y it's wrong to register a platform_driver whose probe
function lives in .init.text because the probe function can be called
(e.g. via sysfs or by registering a device late) after the init sections
are already discarded.  This results in an oops.

So warn if such a driver is registered.

Without HOTPLUG the probe function can (and should) be discarded if the
driver is registered while the init sections are still available.
In this case warn if the probe function isn't discarded later.  (As
described in the comments there is a small chance for a wrong warning.
But as HOTPLUG=n is unusual today and the situation is strage enough to
be cleaned up anyhow, I think this is OK.)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/base/platform.c |   42 ++++++++++++++++++++++++++++++++++++------
 include/linux/kernel.h  |    2 ++
 include/linux/module.h  |   12 ++++++++++++
 kernel/extable.c        |   12 ++++++++++++
 kernel/module.c         |   36 ++++++++++++++++++++++++++++++++++++
 5 files changed, 98 insertions(+), 6 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 81cb01b..851ba84 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -470,11 +470,7 @@ static void platform_drv_shutdown(struct device *_dev)
 	drv->shutdown(dev);
 }
 
-/**
- * platform_driver_register
- * @drv: platform driver structure
- */
-int platform_driver_register(struct platform_driver *drv)
+static int __platform_driver_register(struct platform_driver *drv)
 {
 	drv->driver.bus = &platform_bus_type;
 	if (drv->probe)
@@ -489,6 +485,40 @@ int platform_driver_register(struct platform_driver *drv)
 
 	return driver_register(&drv->driver);
 }
+
+/**
+ * platform_driver_register
+ * @drv: platform driver structure
+ */
+int platform_driver_register(struct platform_driver *drv)
+{
+	int ret = __platform_driver_register(drv);
+
+#if defined(CONFIG_HOTPLUG)
+	/*
+	 * drivers that are registered by platform_driver_register
+	 * should not have their probe function in .init.text.  The
+	 * reason is that a probe can happen after .init.text is
+	 * discarded which then results in an oops.  The alternatives
+	 * are using .devinit.text for the probe function or "register"
+	 * with platform_driver_probe.
+	 */
+	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
+		pr_warning("oops-warning: probe function of platform driver %s"
+			       " lives in .init.text\n", drv->driver.name);
+#else
+	/*
+	 * without HOTPLUG probe functions can be discarded after the driver is
+	 * loaded.
+	 * There is a little chance for false positives, namely if the driver is
+	 * registered after the .init sections are discarded.
+	 */
+	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
+		pr_info("probably the probe function of platform driver %s can"
+				" be moved to .init.text\n", drv->driver.name);
+#endif
+	return ret;
+}
 EXPORT_SYMBOL_GPL(platform_driver_register);
 
 /**
@@ -525,7 +555,7 @@ int __init_or_module platform_driver_probe(struct platform_driver *drv,
 
 	/* temporary section violation during probe() */
 	drv->probe = probe;
-	retval = code = platform_driver_register(drv);
+	retval = code = __platform_driver_register(drv);
 
 	/* Fixup that section violation, being paranoid about code scanning
 	 * the list of drivers in order to probe new devices.  Check to see
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d6320a3..298e9bc 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -203,8 +203,10 @@ extern char *get_options(const char *str, int nints, int *ints);
 extern unsigned long long memparse(const char *ptr, char **retptr);
 
 extern int core_kernel_text(unsigned long addr);
+extern int core_kernel_init_text(unsigned long addr)
 extern int __kernel_text_address(unsigned long addr);
 extern int kernel_text_address(unsigned long addr);
+extern int kernel_init_text_address(unsigned long addr);
 extern int func_ptr_is_kernel_text(void *ptr);
 
 struct pid;
diff --git a/include/linux/module.h b/include/linux/module.h
index 098bdb7..93f47c4 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -385,9 +385,11 @@ static inline int module_is_live(struct module *mod)
 }
 
 struct module *__module_text_address(unsigned long addr);
+struct module *__module_init_text_address(unsigned long addr);
 struct module *__module_address(unsigned long addr);
 bool is_module_address(unsigned long addr);
 bool is_module_text_address(unsigned long addr);
+bool is_module_init_text_address(unsigned long addr);
 
 static inline int within_module_core(unsigned long addr, struct module *mod)
 {
@@ -556,6 +558,11 @@ static inline struct module *__module_text_address(unsigned long addr)
 	return NULL;
 }
 
+static inline struct module *__module_init_text_address(unsigned long addr)
+{
+	return NULL;
+}
+
 static inline bool is_module_address(unsigned long addr)
 {
 	return false;
@@ -566,6 +573,11 @@ static inline bool is_module_text_address(unsigned long addr)
 	return false;
 }
 
+static inline bool is_module_init_text_address(unsigned long addr)
+{
+	return false;
+}
+
 /* Get/put a kernel symbol (calls should be symmetric) */
 #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
 #define symbol_put(x) do { } while(0)
diff --git a/kernel/extable.c b/kernel/extable.c
index 7f8f263..bfd7bda 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -66,6 +66,11 @@ int core_kernel_text(unsigned long addr)
 	    addr <= (unsigned long)_etext)
 		return 1;
 
+	return core_kernel_init_text;
+}
+
+int core_kernel_init_text(unsigned long addr)
+{
 	if (system_state == SYSTEM_BOOTING &&
 	    init_kernel_text(addr))
 		return 1;
@@ -98,6 +103,13 @@ int kernel_text_address(unsigned long addr)
 	return is_module_text_address(addr);
 }
 
+int kernel_init_text_address(unsigned long addr)
+{
+	if (core_kernel_init_text(addr))
+		return 1;
+	return is_module_init_text_address(addr);
+}
+
 /*
  * On some architectures (PPC64, IA64) function pointers
  * are actually only tokens to some data that then holds the
diff --git a/kernel/module.c b/kernel/module.c
index 0a04983..f1fbeb0 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2890,6 +2890,22 @@ bool is_module_text_address(unsigned long addr)
 }
 
 /*
+ * is_module_init_text_address - is this address inside a module's .init.text
+ * section?
+ * @addr: the address to check.
+ */
+bool is_module_init_text_address(unsigned long addr)
+{
+	bool ret;
+
+	preempt_disable();
+	ret = __module_init_text_address(addr) != NULL;
+	preempt_enable();
+
+	return ret;
+}
+
+/*
  * __module_text_address - get the module whose code contains an address.
  * @addr: the address.
  *
@@ -2909,6 +2925,26 @@ struct module *__module_text_address(unsigned long addr)
 }
 EXPORT_SYMBOL_GPL(__module_text_address);
 
+/*
+ * __module_init_text_address - get the module whose .init.text contains an
+ * address.
+ * @addr: the address.
+ *
+ * Must be called with preempt disabled or module mutex held so that
+ * module doesn't get freed during this.
+ */
+struct module *__module_init_text_address(unsigned long addr)
+{
+	struct module *mod = __module_address(addr);
+	if (mod) {
+		/* Make sure it's within the .init.text section. */
+		if (!within(addr, mod->module_init, mod->init_text_size))
+			mod = NULL;
+	}
+	return mod;
+}
+EXPORT_SYMBOL_GPL(__module_init_text_address);
+
 /* Don't grab lock, we're oopsing. */
 void print_modules(void)
 {
-- 
tg: (f00caa7..) t/platsection/warn_in_probe (depends on: linus/master)

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply related	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-07-11 10:00                           ` Uwe Kleine-König
@ 2009-07-11 17:05                             ` Greg KH
  2009-07-11 20:52                                 ` Uwe Kleine-König
                                                 ` (2 more replies)
  2009-07-11 18:59                             ` Greg KH
  1 sibling, 3 replies; 197+ messages in thread
From: Greg KH @ 2009-07-11 17:05 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-kernel

On Sat, Jul 11, 2009 at 12:00:14PM +0200, Uwe Kleine-König wrote:
> Hi Greg,
> 
> > > Are you conviced and took the patch or did you give up to convince me?
> > 
> > Heh, no, sorry, it got burried in my queue.
> > 
> > > I still think the patch is correct and I'd like to have it applied.
> > 
> > Ok, let's test it out in the linux-next tree for a while to make sure it
> > works properly.  Care to send me an updated version?
> I updated to latest Linus' master.  It applies to linux-next from
> Fri Jul 10 14:44:30 2009 +1000 as is.

Thanks, I'll apply it later today to my trees.

> Back some time I sent a series that fixes many of these bugs.  I will
> update it later today and resend.

Thanks, that would be good to have, to keep the noise down for devices
we already know about.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-07-11 10:00                           ` Uwe Kleine-König
  2009-07-11 17:05                             ` Greg KH
@ 2009-07-11 18:59                             ` Greg KH
  2009-07-11 20:46                               ` Uwe Kleine-König
  1 sibling, 1 reply; 197+ messages in thread
From: Greg KH @ 2009-07-11 18:59 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Greg KH, linux-kernel

On Sat, Jul 11, 2009 at 12:00:14PM +0200, Uwe Kleine-König wrote:
> Hi Greg,
> 
> > > Are you conviced and took the patch or did you give up to convince me?
> > 
> > Heh, no, sorry, it got burried in my queue.
> > 
> > > I still think the patch is correct and I'd like to have it applied.
> > 
> > Ok, let's test it out in the linux-next tree for a while to make sure it
> > works properly.  Care to send me an updated version?
> I updated to latest Linus' master.  It applies to linux-next from
> Fri Jul 10 14:44:30 2009 +1000 as is.
> 
> Back some time I sent a series that fixes many of these bugs.  I will
> update it later today and resend.
> 
> Best regards and thanks,
> Uwe
> 
> ---->8----
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Subject: [PATCH] platform_driver_register:  warn if probe is in .init.text
> 
> with HOTPLUG=y it's wrong to register a platform_driver whose probe
> function lives in .init.text because the probe function can be called
> (e.g. via sysfs or by registering a device late) after the init sections
> are already discarded.  This results in an oops.
> 
> So warn if such a driver is registered.
> 
> Without HOTPLUG the probe function can (and should) be discarded if the
> driver is registered while the init sections are still available.
> In this case warn if the probe function isn't discarded later.  (As
> described in the comments there is a small chance for a wrong warning.
> But as HOTPLUG=n is unusual today and the situation is strage enough to
> be cleaned up anyhow, I think this is OK.)
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This code kills the build in very bad ways :(

So much so that the error messages scroll away, but it starts out with:

In file included from /home/gregkh/work/linux/gregkh-2.6/arch/x86/include/asm/percpu.h:45,
                 from /home/gregkh/work/linux/gregkh-2.6/arch/x86/include/asm/current.h:5,
                 from /home/gregkh/work/linux/gregkh-2.6/arch/x86/include/asm/processor.h:15,
                 from /home/gregkh/work/linux/gregkh-2.6/arch/x86/include/asm/atomic_32.h:6,
                 from /home/gregkh/work/linux/gregkh-2.6/arch/x86/include/asm/atomic.h:2,
                 from include/linux/crypto.h:20,
                 from arch/x86/kernel/asm-offsets_32.c:7,
                 from arch/x86/kernel/asm-offsets.c:2:
include/linux/kernel.h: In function ‘core_kernel_init_text’:
include/linux/kernel.h:207: error: storage class specified for parameter ‘__kernel_text_address’
include/linux/kernel.h:208: error: storage class specified for parameter ‘kernel_text_address’
include/linux/kernel.h:209: error: storage class specified for parameter ‘kernel_init_text_address’
include/linux/kernel.h:210: error: storage class specified for parameter ‘func_ptr_is_kernel_text’
include/linux/kernel.h:212: warning: empty declaration


Care to respin this?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-07-11 18:59                             ` Greg KH
@ 2009-07-11 20:46                               ` Uwe Kleine-König
  2009-07-16 22:58                                 ` Greg KH
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Greg KH, linux-kernel

Hello Greg,

On Sat, Jul 11, 2009 at 11:59:20AM -0700, Greg KH wrote:
> On Sat, Jul 11, 2009 at 12:00:14PM +0200, Uwe Kleine-König wrote:
> > Hi Greg,
> > 
> > > > Are you conviced and took the patch or did you give up to convince me?
> > > 
> > > Heh, no, sorry, it got burried in my queue.
> > > 
> > > > I still think the patch is correct and I'd like to have it applied.
> > > 
> > > Ok, let's test it out in the linux-next tree for a while to make sure it
> > > works properly.  Care to send me an updated version?
> > I updated to latest Linus' master.  It applies to linux-next from
> > Fri Jul 10 14:44:30 2009 +1000 as is.
> > 
> > Back some time I sent a series that fixes many of these bugs.  I will
> > update it later today and resend.
> > 
> > Best regards and thanks,
> > Uwe
> > 
> > ---->8----
> > From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > Subject: [PATCH] platform_driver_register:  warn if probe is in .init.text
> > 
> > with HOTPLUG=y it's wrong to register a platform_driver whose probe
> > function lives in .init.text because the probe function can be called
> > (e.g. via sysfs or by registering a device late) after the init sections
> > are already discarded.  This results in an oops.
> > 
> > So warn if such a driver is registered.
> > 
> > Without HOTPLUG the probe function can (and should) be discarded if the
> > driver is registered while the init sections are still available.
> > In this case warn if the probe function isn't discarded later.  (As
> > described in the comments there is a small chance for a wrong warning.
> > But as HOTPLUG=n is unusual today and the situation is strage enough to
> > be cleaned up anyhow, I think this is OK.)
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> This code kills the build in very bad ways :(
it's just a ; that didn't made it into the new version.  Don't know why.

If you squash the patch below into the patch I sent it should work
again.

Sorry
Uwe

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 298e9bc..2d48087 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -203,7 +203,7 @@ extern char *get_options(const char *str, int nints, int *ints);
 extern unsigned long long memparse(const char *ptr, char **retptr);
 
 extern int core_kernel_text(unsigned long addr);
-extern int core_kernel_init_text(unsigned long addr)
+extern int core_kernel_init_text(unsigned long addr);
 extern int __kernel_text_address(unsigned long addr);
 extern int kernel_text_address(unsigned long addr);
 extern int kernel_init_text_address(unsigned long addr);

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move acornfb's probe function to .devinit.text
  2009-07-11 17:05                             ` Greg KH
@ 2009-07-11 20:52                                 ` Uwe Kleine-König
  2009-09-07 14:19                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
  2009-09-21  7:54                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
  2 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Christoph Hellwig, Antonino Daplas, linux-fbdev-devel, Andrew Morton

A pointer to acornfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Antonino Daplas <adaplas@pol.net>
Cc: linux-fbdev-devel@lists.sourceforge.net
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/acornfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index 0bcc59e..43d7d50 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -1221,7 +1221,7 @@ free_unused_pages(unsigned int virtual_start, unsigned int virtual_end)
 	printk("acornfb: freed %dK memory\n", mb_freed);
 }
 
-static int __init acornfb_probe(struct platform_device *dev)
+static int __devinit acornfb_probe(struct platform_device *dev)
 {
 	unsigned long size;
 	u_int h_sync, v_sync;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move acornfb's probe function to .devinit.text
@ 2009-07-11 20:52                                 ` Uwe Kleine-König
  0 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Christoph Hellwig, Antonino Daplas, linux-fbdev-devel, Andrew Morton

A pointer to acornfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Antonino Daplas <adaplas@pol.net>
Cc: linux-fbdev-devel@lists.sourceforge.net
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/acornfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index 0bcc59e..43d7d50 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -1221,7 +1221,7 @@ free_unused_pages(unsigned int virtual_start, unsigned int virtual_end)
 	printk("acornfb: freed %dK memory\n", mb_freed);
 }
 
-static int __init acornfb_probe(struct platform_device *dev)
+static int __devinit acornfb_probe(struct platform_device *dev)
 {
 	unsigned long size;
 	u_int h_sync, v_sync;
-- 
1.6.3.1

^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move am79c961's probe function to .devinit.text
  2009-07-11 20:52                                 ` Uwe Kleine-König
  (?)
@ 2009-07-11 20:52                                 ` Uwe Kleine-König
  2009-07-11 20:52                                   ` [PATCH] move arcfb's " Uwe Kleine-König
  -1 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Roel Kluin, Russell King, netdev, Andrew Morton

A pointer to am79c961_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: netdev@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/net/arm/am79c961a.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index 627bc75..51b19f2 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -680,7 +680,7 @@ static const struct net_device_ops am79c961_netdev_ops = {
 #endif
 };
 
-static int __init am79c961_probe(struct platform_device *pdev)
+static int __devinit am79c961_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct net_device *dev;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move arcfb's probe function to .devinit.text
  2009-07-11 20:52                                 ` [PATCH] move am79c961's " Uwe Kleine-König
@ 2009-07-11 20:52                                   ` Uwe Kleine-König
  2009-07-11 20:52                                     ` [PATCH] move at91_ether's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Antonino Daplas, Andrew Morton

A pointer to arcfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/arcfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index c343169..01554d6 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -504,7 +504,7 @@ static struct fb_ops arcfb_ops = {
 	.fb_ioctl 	= arcfb_ioctl,
 };
 
-static int __init arcfb_probe(struct platform_device *dev)
+static int __devinit arcfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int retval = -ENOMEM;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move at91_ether's probe function to .devinit.text
  2009-07-11 20:52                                   ` [PATCH] move arcfb's " Uwe Kleine-König
@ 2009-07-11 20:52                                     ` Uwe Kleine-König
  2009-07-11 20:52                                       ` [PATCH] move cfag12864bfb's " Uwe Kleine-König
  2009-07-11 22:27                                       ` [PATCH] move at91_ether's " David Brownell
  0 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: David S. Miller, David Brownell, Jeff Garzik, Paulius Zaleckas,
	Marc Pignat, Andrew Victor, Roel Kluin, Andrew Morton

A pointer to at91ether_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Cc: Marc Pignat <marc.pignat@hevs.ch>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/net/arm/at91_ether.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index 2e7419a..0c8860e 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -1119,7 +1119,7 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add
 /*
  * Detect MAC and PHY and perform initialization
  */
-static int __init at91ether_probe(struct platform_device *pdev)
+static int __devinit at91ether_probe(struct platform_device *pdev)
 {
 	unsigned int phyid1, phyid2;
 	int detected = -1;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move cfag12864bfb's probe function to .devinit.text
  2009-07-11 20:52                                     ` [PATCH] move at91_ether's " Uwe Kleine-König
@ 2009-07-11 20:52                                       ` Uwe Kleine-König
  2009-07-11 20:52                                         ` [PATCH] move leds-clevo-mail's " Uwe Kleine-König
  2009-07-11 22:27                                       ` [PATCH] move at91_ether's " David Brownell
  1 sibling, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Andrew Morton, Avuton Olrich, Antonino Daplas

A pointer to cfag12864bfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Avuton Olrich <avuton@gmail.com>
Cc: Antonino Daplas <adaplas@gmail.com>
---
 drivers/auxdisplay/cfag12864bfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c
index fe3a865..b0ca5a4 100644
--- a/drivers/auxdisplay/cfag12864bfb.c
+++ b/drivers/auxdisplay/cfag12864bfb.c
@@ -81,7 +81,7 @@ static struct fb_ops cfag12864bfb_ops = {
 	.fb_mmap = cfag12864bfb_mmap,
 };
 
-static int __init cfag12864bfb_probe(struct platform_device *device)
+static int __devinit cfag12864bfb_probe(struct platform_device *device)
 {
 	int ret = -EINVAL;
  	struct fb_info *info = framebuffer_alloc(0, &device->dev);
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move leds-clevo-mail's probe function to .devinit.text
  2009-07-11 20:52                                       ` [PATCH] move cfag12864bfb's " Uwe Kleine-König
@ 2009-07-11 20:52                                         ` Uwe Kleine-König
  2009-07-11 20:52                                           ` [PATCH] move cobalt-lcd's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Richard Purdie, Andrew Morton, Márton Németh

A pointer to clevo_mail_led_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Richard Purdie <rpurdie@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Márton Németh <nm127@freemail.hu>
---
 drivers/leds/leds-clevo-mail.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/leds/leds-clevo-mail.c b/drivers/leds/leds-clevo-mail.c
index 1813c84..8ee83ce 100644
--- a/drivers/leds/leds-clevo-mail.c
+++ b/drivers/leds/leds-clevo-mail.c
@@ -145,7 +145,7 @@ static struct led_classdev clevo_mail_led = {
 	.flags			= LED_CORE_SUSPENDRESUME,
 };
 
-static int __init clevo_mail_led_probe(struct platform_device *pdev)
+static int __devinit clevo_mail_led_probe(struct platform_device *pdev)
 {
 	return led_classdev_register(&pdev->dev, &clevo_mail_led);
 }
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move cobalt-lcd's probe function to .devinit.text
  2009-07-11 20:52                                         ` [PATCH] move leds-clevo-mail's " Uwe Kleine-König
@ 2009-07-11 20:52                                           ` Uwe Kleine-König
  2009-07-11 20:52                                             ` [PATCH] move corgi-ssp's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Yoichi Yuasa, Krzysztof Helt, Antonino Daplas, Andrew Morton

A pointer to cobalt_lcdfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Antonino Daplas <adaplas@pol.net>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/cobalt_lcdfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/cobalt_lcdfb.c b/drivers/video/cobalt_lcdfb.c
index 108b89e..5eb61b5 100644
--- a/drivers/video/cobalt_lcdfb.c
+++ b/drivers/video/cobalt_lcdfb.c
@@ -287,7 +287,7 @@ static struct fb_ops cobalt_lcd_fbops = {
 	.fb_cursor	= cobalt_lcdfb_cursor,
 };
 
-static int __init cobalt_lcdfb_probe(struct platform_device *dev)
+static int __devinit cobalt_lcdfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct resource *res;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move corgi-ssp's probe function to .devinit.text
  2009-07-11 20:52                                           ` [PATCH] move cobalt-lcd's " Uwe Kleine-König
@ 2009-07-11 20:52                                             ` Uwe Kleine-König
  2009-07-11 20:52                                               ` [PATCH] move efifb's " Uwe Kleine-König
  2009-07-13  8:44                                               ` [PATCH] move corgi-ssp's " Eric Miao
  0 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Eric Miao, Russell King, Paul Sokolovsky, Richard Purdie,
	Liam Girdwood, Andrew Morton

A pointer to corgi_ssp_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (when having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Eric Miao <eric.miao@marvell.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Paul Sokolovsky <pmiscml@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 arch/arm/mach-pxa/corgi_ssp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index a5ee707..1d9bc11 100644
--- a/arch/arm/mach-pxa/corgi_ssp.c
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -204,7 +204,7 @@ void __init corgi_ssp_set_machinfo(struct corgissp_machinfo *machinfo)
 	ssp_machinfo = machinfo;
 }
 
-static int __init corgi_ssp_probe(struct platform_device *dev)
+static int __devinit corgi_ssp_probe(struct platform_device *dev)
 {
 	int ret;
 
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move efifb's probe function to .devinit.text
  2009-07-11 20:52                                             ` [PATCH] move corgi-ssp's " Uwe Kleine-König
@ 2009-07-11 20:52                                               ` Uwe Kleine-König
  2009-07-11 20:52                                                 ` [PATCH] move epson1355fb's " Uwe Kleine-König
  2009-07-13 13:51                                                 ` [PATCH] move efifb's " Peter Jones
  2009-07-13  8:44                                               ` [PATCH] move corgi-ssp's " Eric Miao
  1 sibling, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Peter Jones, Krzysztof Helt, Geert Uytterhoeven, Jaya Kumar,
	Ralf Baechle, Maciej W. Rozycki, Andrew Morton,
	Chandramouli Narayanan, Huang Ying

A pointer to efifb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Peter Jones <pjones@redhat.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Chandramouli Narayanan <mouli@linux.intel.com>
Cc: Huang Ying <ying.huang@intel.com>
---
 drivers/video/efifb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index eb12182..2161f21 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -201,7 +201,7 @@ static int __init efifb_setup(char *options)
 	return 0;
 }
 
-static int __init efifb_probe(struct platform_device *dev)
+static int __devinit efifb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int err;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move epson1355fb's probe function to .devinit.text
  2009-07-11 20:52                                               ` [PATCH] move efifb's " Uwe Kleine-König
@ 2009-07-11 20:52                                                 ` Uwe Kleine-König
  2009-07-11 20:52                                                   ` [PATCH] move sh_flctl's " Uwe Kleine-König
  2009-07-13 13:51                                                 ` [PATCH] move efifb's " Peter Jones
  1 sibling, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Russell King, Krzysztof Helt, Antonino Daplas, Andrew Morton,
	Paul Mundt, Roland Stigge, Greg Kroah-Hartman

A pointer to epson1355fb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Roland Stigge <stigge@antcom.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/video/epson1355fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c
index 2735b79..6d755bb 100644
--- a/drivers/video/epson1355fb.c
+++ b/drivers/video/epson1355fb.c
@@ -602,7 +602,7 @@ static int epson1355fb_remove(struct platform_device *dev)
 	return 0;
 }
 
-int __init epson1355fb_probe(struct platform_device *dev)
+int __devinit epson1355fb_probe(struct platform_device *dev)
 {
 	struct epson1355_par *default_par;
 	struct fb_info *info;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move sh_flctl's probe function to .devinit.text
  2009-07-11 20:52                                                 ` [PATCH] move epson1355fb's " Uwe Kleine-König
@ 2009-07-11 20:52                                                   ` Uwe Kleine-König
  2009-07-11 20:52                                                     ` [PATCH] move gbefb's " Uwe Kleine-König
  2009-09-19 23:09                                                     ` [PATCH] move sh_flctl's " David Woodhouse
  0 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: David Woodhouse, Paul Mundt, Andrew Morton

A pointer to flctl_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/mtd/nand/sh_flctl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
index 2bc8966..1898423 100644
--- a/drivers/mtd/nand/sh_flctl.c
+++ b/drivers/mtd/nand/sh_flctl.c
@@ -769,7 +769,7 @@ static int flctl_chip_init_tail(struct mtd_info *mtd)
 	return 0;
 }
 
-static int __init flctl_probe(struct platform_device *pdev)
+static int __devinit flctl_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct sh_flctl *flctl;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move gbefb's probe function to .devinit.text
  2009-07-11 20:52                                                   ` [PATCH] move sh_flctl's " Uwe Kleine-König
@ 2009-07-11 20:52                                                     ` Uwe Kleine-König
  2009-07-11 20:52                                                       ` [PATCH] move h1940-bt's " Uwe Kleine-König
  2009-09-19 23:09                                                     ` [PATCH] move sh_flctl's " David Woodhouse
  1 sibling, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Roel Kluin, Krzysztof Helt, Thomas Bogendoerfer, Andrew Morton,
	Antonino Daplas, Kaj-Michael Lang, Martin Michlmayr,
	Joshua Kinard

A pointer to gbefb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Roel Kluin <roel.kluin@gmail.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Antonino Daplas <adaplas@pol.net>
Cc: Kaj-Michael Lang <milang@tal.org>
Cc: Martin Michlmayr <tbm@cyrius.com>
Cc: Joshua Kinard <kumba@gentoo.org>
---
 drivers/video/gbefb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index 1a83709..f30e6b7 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -1128,7 +1128,7 @@ static int __init gbefb_setup(char *options)
 	return 0;
 }
 
-static int __init gbefb_probe(struct platform_device *p_dev)
+static int __devinit gbefb_probe(struct platform_device *p_dev)
 {
 	int i, ret = 0;
 	struct fb_info *info;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move h1940-bt's probe function to .devinit.text
  2009-07-11 20:52                                                     ` [PATCH] move gbefb's " Uwe Kleine-König
@ 2009-07-11 20:52                                                       ` Uwe Kleine-König
  2009-07-11 20:52                                                         ` [PATCH] move hgafb's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Russell King, Arnaud Patard, Ben Dooks, Andrew Morton

A pointer to h1940bt_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 arch/arm/mach-s3c2410/h1940-bluetooth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c
index 5aabf11..194c2eb 100644
--- a/arch/arm/mach-s3c2410/h1940-bluetooth.c
+++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c
@@ -86,7 +86,7 @@ static DEVICE_ATTR(enable, 0644,
 		h1940bt_show,
 		h1940bt_store);
 
-static int __init h1940bt_probe(struct platform_device *pdev)
+static int __devinit h1940bt_probe(struct platform_device *pdev)
 {
 	/* Configures BT serial port GPIOs */
 	s3c2410_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0);
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move hgafb's probe function to .devinit.text
  2009-07-11 20:52                                                       ` [PATCH] move h1940-bt's " Uwe Kleine-König
@ 2009-07-11 20:52                                                         ` Uwe Kleine-König
  2009-07-11 20:52                                                           ` [PATCH] move hitfb's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Krzysztof Helt, Andrew Morton, Anton Vorontsov, Antonino Daplas

A pointer to hgafb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Antonino Daplas <adaplas@pol.net>
---
 drivers/video/hgafb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c
index 0129c04..db9b785 100644
--- a/drivers/video/hgafb.c
+++ b/drivers/video/hgafb.c
@@ -551,7 +551,7 @@ static struct fb_ops hgafb_ops = {
 	 *  Initialization
 	 */
 
-static int __init hgafb_probe(struct platform_device *pdev)
+static int __devinit hgafb_probe(struct platform_device *pdev)
 {
 	struct fb_info *info;
 
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move hitfb's probe function to .devinit.text
  2009-07-11 20:52                                                         ` [PATCH] move hgafb's " Uwe Kleine-König
@ 2009-07-11 20:52                                                           ` Uwe Kleine-König
  2009-07-11 20:52                                                             ` [PATCH] move hp680-bl's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Paul Mundt, Andriy Skulysh, Antonino Daplas, Andrew Morton

A pointer to hitfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Andriy Skulysh <askulysh@gmail.com>
Cc: Antonino Daplas <adaplas@pol.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/hitfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c
index e7116a6..3016cd2 100644
--- a/drivers/video/hitfb.c
+++ b/drivers/video/hitfb.c
@@ -325,7 +325,7 @@ static struct fb_ops hitfb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static int __init hitfb_probe(struct platform_device *dev)
+static int __devinit hitfb_probe(struct platform_device *dev)
 {
 	unsigned short lcdclor, ldr3, ldvndr;
 	struct fb_info *info;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move hp680-bl's probe function to .devinit.text
  2009-07-11 20:52                                                           ` [PATCH] move hitfb's " Uwe Kleine-König
@ 2009-07-11 20:52                                                             ` Uwe Kleine-König
  2009-07-11 20:52                                                               ` [PATCH] move hp-wmi's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Akinobu Mita, Richard Purdie, Paul Mundt, Andrew Morton,
	Andriy Skulysh, Antonino Daplas

A pointer to hp680bl_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Richard Purdie <rpurdie@linux.intel.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Acked-by: Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andriy Skulysh <askulysh@gmail.com>
Cc: Antonino Daplas <adaplas@pol.net>
---
 drivers/video/backlight/hp680_bl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c
index 5be55a2..7fb4eef 100644
--- a/drivers/video/backlight/hp680_bl.c
+++ b/drivers/video/backlight/hp680_bl.c
@@ -103,7 +103,7 @@ static struct backlight_ops hp680bl_ops = {
 	.update_status  = hp680bl_set_intensity,
 };
 
-static int __init hp680bl_probe(struct platform_device *pdev)
+static int __devinit hp680bl_probe(struct platform_device *pdev)
 {
 	struct backlight_device *bd;
 
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move hp-wmi's probe function to .devinit.text
  2009-07-11 20:52                                                             ` [PATCH] move hp680-bl's " Uwe Kleine-König
@ 2009-07-11 20:52                                                               ` Uwe Kleine-König
  2009-07-11 20:52                                                                 ` [PATCH] move jazzsonic's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Frans Pop, Larry Finger, Len Brown, Helge Deller,
	Matthew Garrett, Andrew Morton

A pointer to hp_wmi_bios_setup is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Frans Pop <elendil@planet.nl>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Len Brown <lenb@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/platform/x86/hp-wmi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index ca50856..f1f7090 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -51,7 +51,7 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
 #define HPWMI_WIRELESS_QUERY 0x5
 #define HPWMI_HOTKEY_QUERY 0xc
 
-static int __init hp_wmi_bios_setup(struct platform_device *device);
+static int __devinit hp_wmi_bios_setup(struct platform_device *device);
 static int __exit hp_wmi_bios_remove(struct platform_device *device);
 static int hp_wmi_resume_handler(struct platform_device *device);
 
@@ -425,7 +425,7 @@ static void cleanup_sysfs(struct platform_device *device)
 	device_remove_file(&device->dev, &dev_attr_tablet);
 }
 
-static int __init hp_wmi_bios_setup(struct platform_device *device)
+static int __devinit hp_wmi_bios_setup(struct platform_device *device)
 {
 	int err;
 	int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0);
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move jazzsonic's probe function to .devinit.text
  2009-07-11 20:52                                                               ` [PATCH] move hp-wmi's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                 ` Uwe Kleine-König
  2009-07-11 20:52                                                                   ` [PATCH] move jornada_ssp's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Jeff Garzik, David S. Miller, Thomas Bogendoerfer, Finn Thain,
	Geert Uytterhoeven, Andrew Morton

A pointer to jazz_sonic_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

As noticed by Geert Uytterhoeven sonic_probe1 is called by
jazz_sonic_probe, so the former has to move to .devinit.text, too.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Finn Thain <fthain@telegraphics.com.au>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/net/jazzsonic.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c
index d12106b..8baf595 100644
--- a/drivers/net/jazzsonic.c
+++ b/drivers/net/jazzsonic.c
@@ -108,7 +108,7 @@ static const struct net_device_ops sonic_netdev_ops = {
 	.ndo_set_mac_address	= eth_mac_addr,
 };
 
-static int __init sonic_probe1(struct net_device *dev)
+static int __devinit sonic_probe1(struct net_device *dev)
 {
 	static unsigned version_printed;
 	unsigned int silicon_revision;
@@ -211,7 +211,7 @@ out:
  * Probe for a SONIC ethernet controller on a Mips Jazz board.
  * Actually probing is superfluous but we're paranoid.
  */
-static int __init jazz_sonic_probe(struct platform_device *pdev)
+static int __devinit jazz_sonic_probe(struct platform_device *pdev)
 {
 	struct net_device *dev;
 	struct sonic_local *lp;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move jornada_ssp's probe function to .devinit.text
  2009-07-11 20:52                                                                 ` [PATCH] move jazzsonic's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                   ` Uwe Kleine-König
  2009-07-11 20:52                                                                     ` [PATCH] move macsonic's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Russell King, Andrew Morton

A pointer to jornada_ssp_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 arch/arm/mach-sa1100/jornada720_ssp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c
index 506a5e5..9b6dee5 100644
--- a/arch/arm/mach-sa1100/jornada720_ssp.c
+++ b/arch/arm/mach-sa1100/jornada720_ssp.c
@@ -130,7 +130,7 @@ void jornada_ssp_end(void)
 };
 EXPORT_SYMBOL(jornada_ssp_end);
 
-static int __init jornada_ssp_probe(struct platform_device *dev)
+static int __devinit jornada_ssp_probe(struct platform_device *dev)
 {
 	int ret;
 
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move macsonic's probe function to .devinit.text
  2009-07-11 20:52                                                                   ` [PATCH] move jornada_ssp's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                     ` Uwe Kleine-König
  2009-07-11 20:52                                                                       ` [PATCH] move meth's " Uwe Kleine-König
  2009-07-21 15:14                                                                       ` [PATCH] move macsonic's probe function to .devinit.text Finn Thain
  0 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Jeff Garzik, David S. Miller, Finn Thain, Geert Uytterhoeven,
	Andrew Morton

A pointer to mac_sonic_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

Various other functions that are called by mac_sonic_probe need to move
to .devinit.text, too.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Finn Thain <fthain@telegraphics.com.au>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/net/macsonic.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index acd143d..8f492c7 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -179,7 +179,7 @@ static const struct net_device_ops macsonic_netdev_ops = {
 	.ndo_set_mac_address	= eth_mac_addr,
 };
 
-static int __init macsonic_init(struct net_device *dev)
+static int __devinit macsonic_init(struct net_device *dev)
 {
 	struct sonic_local* lp = netdev_priv(dev);
 
@@ -223,7 +223,7 @@ static int __init macsonic_init(struct net_device *dev)
 	return 0;
 }
 
-static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev)
+static int __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev)
 {
 	struct sonic_local *lp = netdev_priv(dev);
 	const int prom_addr = ONBOARD_SONIC_PROM_BASE;
@@ -288,7 +288,7 @@ static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev)
 	} else return 0;
 }
 
-static int __init mac_onboard_sonic_probe(struct net_device *dev)
+static int __devinit mac_onboard_sonic_probe(struct net_device *dev)
 {
 	/* Bwahahaha */
 	static int once_is_more_than_enough;
@@ -409,7 +409,7 @@ static int __init mac_onboard_sonic_probe(struct net_device *dev)
 	return macsonic_init(dev);
 }
 
-static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev,
+static int __devinit mac_nubus_sonic_ethernet_addr(struct net_device *dev,
 						unsigned long prom_addr,
 						int id)
 {
@@ -424,7 +424,7 @@ static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev,
 	return 0;
 }
 
-static int __init macsonic_ident(struct nubus_dev *ndev)
+static int __devinit macsonic_ident(struct nubus_dev *ndev)
 {
 	if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC &&
 	    ndev->dr_sw == NUBUS_DRSW_SONIC_LC)
@@ -449,7 +449,7 @@ static int __init macsonic_ident(struct nubus_dev *ndev)
 	return -1;
 }
 
-static int __init mac_nubus_sonic_probe(struct net_device *dev)
+static int __devinit mac_nubus_sonic_probe(struct net_device *dev)
 {
 	static int slots;
 	struct nubus_dev* ndev = NULL;
@@ -562,7 +562,7 @@ static int __init mac_nubus_sonic_probe(struct net_device *dev)
 	return macsonic_init(dev);
 }
 
-static int __init mac_sonic_probe(struct platform_device *pdev)
+static int __devinit mac_sonic_probe(struct platform_device *pdev)
 {
 	struct net_device *dev;
 	struct sonic_local *lp;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move meth's probe function to .devinit.text
  2009-07-11 20:52                                                                     ` [PATCH] move macsonic's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                       ` Uwe Kleine-König
  2009-07-11 20:52                                                                         ` [PATCH] move omap24xxcam's " Uwe Kleine-König
  2009-07-21 15:14                                                                       ` [PATCH] move macsonic's probe function to .devinit.text Finn Thain
  1 sibling, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: David S. Miller, Thomas Bogendoerfer, Christoph Lameter,
	Jeff Garzik, Andrew Morton

A pointer to meth_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/net/meth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/meth.c b/drivers/net/meth.c
index 5d04d94..0dddb02 100644
--- a/drivers/net/meth.c
+++ b/drivers/net/meth.c
@@ -784,7 +784,7 @@ static const struct net_device_ops meth_netdev_ops = {
 /*
  * The init function.
  */
-static int __init meth_probe(struct platform_device *pdev)
+static int __devinit meth_probe(struct platform_device *pdev)
 {
 	struct net_device *dev;
 	struct meth_private *priv;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move omap24xxcam's probe function to .devinit.text
  2009-07-11 20:52                                                                       ` [PATCH] move meth's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                         ` Uwe Kleine-König
  2009-07-11 20:52                                                                           ` [PATCH] move omap_hdq's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Hans Verkuil, Mauro Carvalho Chehab, Andrew Morton

A pointer to omap24xxcam_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Acked-by: Trilok Soni <soni.trilok@gmail.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/media/video/omap24xxcam.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c
index 5fc4ac0..3fc84b7 100644
--- a/drivers/media/video/omap24xxcam.c
+++ b/drivers/media/video/omap24xxcam.c
@@ -1737,7 +1737,7 @@ static struct v4l2_int_device omap24xxcam = {
  *
  */
 
-static int __init omap24xxcam_probe(struct platform_device *pdev)
+static int __devinit omap24xxcam_probe(struct platform_device *pdev)
 {
 	struct omap24xxcam_device *cam;
 	struct resource *mem;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move omap_hdq's probe function to .devinit.text
  2009-07-11 20:52                                                                         ` [PATCH] move omap24xxcam's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                           ` Uwe Kleine-König
  2009-07-11 20:52                                                                             ` [PATCH] move i2c_omap's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Stanley.Miao, Andrew Morton, Madhusudhan Chikkature, Felipe Balbi

A pointer to omap_hdq_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Stanley.Miao <stanley.miao@windriver.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
---
 drivers/w1/masters/omap_hdq.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index a7e3b70..ac09735 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -72,7 +72,7 @@ struct hdq_data {
 	int			init_trans;
 };
 
-static int __init omap_hdq_probe(struct platform_device *pdev);
+static int __devinit omap_hdq_probe(struct platform_device *pdev);
 static int omap_hdq_remove(struct platform_device *pdev);
 
 static struct platform_driver omap_hdq_driver = {
@@ -558,7 +558,7 @@ static void omap_w1_write_byte(void *_hdq, u8 byte)
 	return;
 }
 
-static int __init omap_hdq_probe(struct platform_device *pdev)
+static int __devinit omap_hdq_probe(struct platform_device *pdev)
 {
 	struct hdq_data *hdq_data;
 	struct resource *res;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move i2c_omap's probe function to .devinit.text
  2009-07-11 20:52                                                                           ` [PATCH] move omap_hdq's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                             ` Uwe Kleine-König
  2009-07-11 20:52                                                                               ` [PATCH] move mmci-omap-hs's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Kalle Jokiniemi, Tony Lindgren, Paul Walmsley, Richard Woodruff,
	chandra shekhar, Jason P Marini, Syed Mohammed Khasim,
	Jarkko Nikula, Juha Yrjola, Andrew Morton

A pointer to omap_i2c_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Kalle Jokiniemi <ext-kalle.jokiniemi@nokia.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
Cc: chandra shekhar <x0044955@ti.com>
Cc: Jason P Marini <jason.marini@gmail.com>
Cc: Syed Mohammed Khasim  <x0khasim@ti.com>
Cc: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: Juha Yrjola <juha.yrjola@solidboot.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/i2c/busses/i2c-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index ad8d201..1ae5ae4 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -784,7 +784,7 @@ static const struct i2c_algorithm omap_i2c_algo = {
 	.functionality	= omap_i2c_func,
 };
 
-static int __init
+static int __devinit
 omap_i2c_probe(struct platform_device *pdev)
 {
 	struct omap_i2c_dev	*dev;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move mmci-omap-hs's probe function to .devinit.text
  2009-07-11 20:52                                                                             ` [PATCH] move i2c_omap's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                               ` Uwe Kleine-König
  2009-07-11 20:52                                                                                 ` [PATCH] move orion_nand's " Uwe Kleine-König
  2009-07-11 22:29                                                                                 ` [PATCH] move mmci-omap-hs's probe function to .devinit.text David Brownell
  0 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Jean Pihet, Tony Lindgren, Pierre Ossman, Andy Lowe,
	Adrian Hunter, Andrew Morton, David Brownell,
	Madhusudhan Chikkature

A pointer to omap_mmc_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Jean Pihet <jpihet@mvista.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Pierre Ossman <drzeus@drzeus.cx>
Cc: Andy Lowe <alowe@mvista.com>
Cc: Adrian Hunter <ext-adrian.hunter@nokia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Madhusudhan Chikkature<madhu.cr@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 1cf9cfb..dc9a430 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -967,7 +967,7 @@ static struct mmc_host_ops mmc_omap_ops = {
 	/* NYET -- enable_sdio_irq */
 };
 
-static int __init omap_mmc_probe(struct platform_device *pdev)
+static int __devinit omap_mmc_probe(struct platform_device *pdev)
 {
 	struct omap_mmc_platform_data *pdata = pdev->dev.platform_data;
 	struct mmc_host *mmc;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move orion_nand's probe function to .devinit.text
  2009-07-11 20:52                                                                               ` [PATCH] move mmci-omap-hs's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                                 ` Uwe Kleine-König
  2009-07-11 20:52                                                                                   ` [PATCH] move q40fb's " Uwe Kleine-König
  2009-07-13 19:37                                                                                   ` [PATCH] move orion_nand's " Nicolas Pitre
  2009-07-11 22:29                                                                                 ` [PATCH] move mmci-omap-hs's probe function to .devinit.text David Brownell
  1 sibling, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Lennert Buytenhek, Saeed Bishara, Jörn Engel, Nicolas Pitre,
	Tzachi Perelstein, Andrew Morton

A pointer to orion_nand_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Lennert Buytenhek <buytenh@marvell.com>
Cc: Saeed Bishara <saeed@marvell.com>
Cc: Jörn Engel <joern@logfs.org>
Cc: Nicolas Pitre <nico@marvell.com>
Cc: Tzachi Perelstein <tzachi@marvell.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/mtd/nand/orion_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 7ad9722..748112c 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -69,7 +69,7 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
 		buf[i++] = readb(io_base);
 }
 
-static int __init orion_nand_probe(struct platform_device *pdev)
+static int __devinit orion_nand_probe(struct platform_device *pdev)
 {
 	struct mtd_info *mtd;
 	struct nand_chip *nc;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move q40fb's probe function to .devinit.text
  2009-07-11 20:52                                                                                 ` [PATCH] move orion_nand's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                                   ` Uwe Kleine-König
  2009-07-11 20:52                                                                                     ` [PATCH] move s3c241xfb's " Uwe Kleine-König
  2009-07-13 19:37                                                                                   ` [PATCH] move orion_nand's " Nicolas Pitre
  1 sibling, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Antonino Daplas, Andrew Morton

A pointer to q40fb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/q40fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c
index 4beac1d..de40a62 100644
--- a/drivers/video/q40fb.c
+++ b/drivers/video/q40fb.c
@@ -85,7 +85,7 @@ static struct fb_ops q40fb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static int __init q40fb_probe(struct platform_device *dev)
+static int __devinit q40fb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move s3c241xfb's probe function to .devinit.text
  2009-07-11 20:52                                                                                   ` [PATCH] move q40fb's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                                     ` Uwe Kleine-König
  2009-07-11 20:52                                                                                       ` [PATCH] move sa11x0-fb's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Russell King, Ben Dooks, Arnaud Patard, Krzysztof Helt,
	Andrew Morton, Antonino Daplas, Vincent Sanders

Pointers to s3c2410fb_probe and s3c2412fb_probe are passed to the core
via platform_driver_register and so the functions must not disappear
when the .init sections are discarded.  Otherwise (if also having
HOTPLUG=y) unbinding and binding a device to one of the drivers via
sysfs will result in an oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Antonino Daplas <adaplas@pol.net>
Cc: Vincent Sanders <vince@simtec.co.uk>
---
 drivers/video/s3c2410fb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 7da0027..b8269bd 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -1002,12 +1002,12 @@ dealloc_fb:
 	return ret;
 }
 
-static int __init s3c2410fb_probe(struct platform_device *pdev)
+static int __devinit s3c2410fb_probe(struct platform_device *pdev)
 {
 	return s3c24xxfb_probe(pdev, DRV_S3C2410);
 }
 
-static int __init s3c2412fb_probe(struct platform_device *pdev)
+static int __devinit s3c2412fb_probe(struct platform_device *pdev)
 {
 	return s3c24xxfb_probe(pdev, DRV_S3C2412);
 }
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move sa11x0-fb's probe function to .devinit.text
  2009-07-11 20:52                                                                                     ` [PATCH] move s3c241xfb's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                                       ` Uwe Kleine-König
  2009-07-11 20:52                                                                                         ` [PATCH] move sb1250-mac's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Russell King, Matthias Kaehlcke, Andrew Morton, Antonino Daplas,
	Pavel Machek, Christoph Hellwig

A pointer to sa1100fb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Matthias Kaehlcke <matthias@kaehlcke.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Pavel Machek <pavel@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>
---
 drivers/video/sa1100fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index 10ddad8..19c012b 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -1435,7 +1435,7 @@ static struct sa1100fb_info * __init sa1100fb_init_fbinfo(struct device *dev)
 	return fbi;
 }
 
-static int __init sa1100fb_probe(struct platform_device *pdev)
+static int __devinit sa1100fb_probe(struct platform_device *pdev)
 {
 	struct sa1100fb_info *fbi;
 	int ret, irq;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move sb1250-mac's probe function to .devinit.text
  2009-07-11 20:52                                                                                       ` [PATCH] move sa11x0-fb's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                                         ` Uwe Kleine-König
  2009-07-11 20:52                                                                                           ` [PATCH] move sgiseeq's " Uwe Kleine-König
  2009-07-12  0:36                                                                                           ` [PATCH] move sb1250-mac's " Maciej W. Rozycki
  0 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Weiwei Wang, Jeff Garzik, David S. Miller, Stephen Hemminger,
	Maciej W. Rozycki, Andrew Morton

A pointer to sbmac_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Weiwei Wang <weiwei.wang@windriver.com>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/net/sb1250-mac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c
index d8c9cf1..96b37b9 100644
--- a/drivers/net/sb1250-mac.c
+++ b/drivers/net/sb1250-mac.c
@@ -2688,7 +2688,7 @@ static int sbmac_poll(struct napi_struct *napi, int budget)
 }
 
 
-static int __init sbmac_probe(struct platform_device *pldev)
+static int __devinit sbmac_probe(struct platform_device *pldev)
 {
 	struct net_device *dev;
 	struct sbmac_softc *sc;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move sgiseeq's probe function to .devinit.text
  2009-07-11 20:52                                                                                         ` [PATCH] move sb1250-mac's " Uwe Kleine-König
@ 2009-07-11 20:52                                                                                           ` Uwe Kleine-König
  2009-07-11 20:53                                                                                             ` [PATCH] move sgivwfb's " Uwe Kleine-König
  2009-07-12  0:36                                                                                           ` [PATCH] move sb1250-mac's " Maciej W. Rozycki
  1 sibling, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Wang Chen, David S. Miller, Andrew Morton, Jeff Garzik,
	Thomas Bogendoerfer

A pointer to sgiseeq_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Wang Chen <wangchen@cn.fujitsu.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
---
 drivers/net/sgiseeq.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c
index 5fb88ca..53fa4f6 100644
--- a/drivers/net/sgiseeq.c
+++ b/drivers/net/sgiseeq.c
@@ -720,7 +720,7 @@ static const struct net_device_ops sgiseeq_netdev_ops = {
 	.ndo_validate_addr	= eth_validate_addr,
 };
 
-static int __init sgiseeq_probe(struct platform_device *pdev)
+static int __devinit sgiseeq_probe(struct platform_device *pdev)
 {
 	struct sgiseeq_platform_data *pd = pdev->dev.platform_data;
 	struct hpc3_regs *hpcregs = pd->hpc;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move sgivwfb's probe function to .devinit.text
  2009-07-11 20:52                                                                                           ` [PATCH] move sgiseeq's " Uwe Kleine-König
@ 2009-07-11 20:53                                                                                             ` Uwe Kleine-König
  2009-07-11 20:53                                                                                               ` [PATCH] move sgiwd93's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:53 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Antonino Daplas, Andrew Morton, Adrian Bunk, Christoph Hellwig

A pointer to sgivwfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Adrian Bunk <bunk@stusta.de>
Cc: Christoph Hellwig <hch@lst.de>
---
 drivers/video/sgivwfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c
index bba5371..aff893e 100644
--- a/drivers/video/sgivwfb.c
+++ b/drivers/video/sgivwfb.c
@@ -745,7 +745,7 @@ int __init sgivwfb_setup(char *options)
 /*
  *  Initialisation
  */
-static int __init sgivwfb_probe(struct platform_device *dev)
+static int __devinit sgivwfb_probe(struct platform_device *dev)
 {
 	struct sgivw_par *par;
 	struct fb_info *info;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move sgiwd93's probe function to .devinit.text
  2009-07-11 20:53                                                                                             ` [PATCH] move sgivwfb's " Uwe Kleine-König
@ 2009-07-11 20:53                                                                                               ` Uwe Kleine-König
  2009-07-11 20:53                                                                                                 ` [PATCH] move sharpsl-pm's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:53 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Dmitri Vorobiev, James Bottomley, Thomas Bogendoerfer,
	Andrew Morton, peter fuerst, Henrik Kretzschmar

A pointer to sgiwd93_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: peter fuerst <post@pfrst.de>
Cc: Henrik Kretzschmar <henne@nachtwindheim.de>
---
 drivers/scsi/sgiwd93.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index 0807b26..fef0e3c 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -226,7 +226,7 @@ static struct scsi_host_template sgiwd93_template = {
 	.use_clustering		= DISABLE_CLUSTERING,
 };
 
-static int __init sgiwd93_probe(struct platform_device *pdev)
+static int __devinit sgiwd93_probe(struct platform_device *pdev)
 {
 	struct sgiwd93_platform_data *pd = pdev->dev.platform_data;
 	unsigned char *wdregs = pd->wdregs;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move sharpsl-pm's probe function to .devinit.text
  2009-07-11 20:53                                                                                               ` [PATCH] move sgiwd93's " Uwe Kleine-König
@ 2009-07-11 20:53                                                                                                 ` Uwe Kleine-König
  2009-07-11 20:53                                                                                                   ` [PATCH] move sh_mobile_lcdc_fb's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:53 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Dmitry Baryshkov, Russell King, Andrew Morton

A pointer to sharpsl_pm_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Eric Miao <eric.miao@marvell.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 arch/arm/mach-pxa/sharpsl_pm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index 2546c06..16a3873 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -899,7 +899,7 @@ static struct platform_suspend_ops sharpsl_pm_ops = {
 };
 #endif
 
-static int __init sharpsl_pm_probe(struct platform_device *pdev)
+static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
 {
 	int ret;
 
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move sh_mobile_lcdc_fb's probe function to .devinit.text
  2009-07-11 20:53                                                                                                 ` [PATCH] move sharpsl-pm's " Uwe Kleine-König
@ 2009-07-11 20:53                                                                                                   ` Uwe Kleine-König
  2009-07-11 20:53                                                                                                     ` [PATCH] move snirm_53c710's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:53 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Greg Kroah-Hartman, Magnus Damm, Paul Mundt, Krzysztof Helt,
	Andrew Morton

A pointer to sh_mobile_lcdc_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Magnus Damm <damm@igel.co.jp>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/sh_mobile_lcdcfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 8f24564..d2bfbde 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -733,7 +733,7 @@ static struct dev_pm_ops sh_mobile_lcdc_dev_pm_ops = {
 
 static int sh_mobile_lcdc_remove(struct platform_device *pdev);
 
-static int __init sh_mobile_lcdc_probe(struct platform_device *pdev)
+static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
 {
 	struct fb_info *info;
 	struct sh_mobile_lcdc_priv *priv;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move snirm_53c710's probe function to .devinit.text
  2009-07-11 20:53                                                                                                   ` [PATCH] move sh_mobile_lcdc_fb's " Uwe Kleine-König
@ 2009-07-11 20:53                                                                                                     ` Uwe Kleine-König
  2009-07-11 20:53                                                                                                       ` [PATCH] move stk17ta8's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:53 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Kay Sievers, David Brownell, Andrew Morton, James Bottomley,
	Thomas Bogendoerfer

A pointer to snirm710_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
 drivers/scsi/sni_53c710.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sni_53c710.c b/drivers/scsi/sni_53c710.c
index 37b3359..56cf0bb 100644
--- a/drivers/scsi/sni_53c710.c
+++ b/drivers/scsi/sni_53c710.c
@@ -64,7 +64,7 @@ static struct scsi_host_template snirm710_template = {
 	.module		= THIS_MODULE,
 };
 
-static int __init snirm710_probe(struct platform_device *dev)
+static int __devinit snirm710_probe(struct platform_device *dev)
 {
 	unsigned long base;
 	struct NCR_700_Host_Parameters *hostdata;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move stk17ta8's probe function to .devinit.text
  2009-07-11 20:53                                                                                                     ` [PATCH] move snirm_53c710's " Uwe Kleine-König
@ 2009-07-11 20:53                                                                                                       ` Uwe Kleine-König
  2009-07-11 20:53                                                                                                         ` [PATCH] move omap_udc's " Uwe Kleine-König
                                                                                                                           ` (2 more replies)
  0 siblings, 3 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:53 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Anton Vorontsov, Alessandro Zummo, David Brownell, Paul Mundt,
	Andrew Morton, Hannes Eder, Jiri Kosina

A pointer to stk17ta8_rtc_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Hannes Eder <hannes@hanneseder.net>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: David Brownell <dbrownell@users.sourceforge.net>
---
 drivers/rtc/rtc-stk17ta8.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/rtc/rtc-stk17ta8.c b/drivers/rtc/rtc-stk17ta8.c
index 7d1547b..d491eb2 100644
--- a/drivers/rtc/rtc-stk17ta8.c
+++ b/drivers/rtc/rtc-stk17ta8.c
@@ -286,7 +286,7 @@ static struct bin_attribute stk17ta8_nvram_attr = {
 	.write = stk17ta8_nvram_write,
 };
 
-static int __init stk17ta8_rtc_probe(struct platform_device *pdev)
+static int __devinit stk17ta8_rtc_probe(struct platform_device *pdev)
 {
 	struct rtc_device *rtc;
 	struct resource *res;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-11 20:53                                                                                                       ` [PATCH] move stk17ta8's " Uwe Kleine-König
@ 2009-07-11 20:53                                                                                                         ` Uwe Kleine-König
  2009-07-11 20:53                                                                                                           ` [PATCH] move vesafb's " Uwe Kleine-König
  2009-07-11 22:30                                                                                                           ` [PATCH] move omap_udc's " David Brownell
  2009-08-13  9:59                                                                                                         ` [PATCH] move stk17ta8's probe function to .devinit.text Jiri Kosina
  2009-10-09 15:24                                                                                                         ` Jiri Kosina
  2 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:53 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Philipp Zabel, David Brownell, Greg Kroah-Hartman, Andrew Morton,
	Tony Lindgren, Russell King, Dmitry Baryshkov

A pointer to omap_udc_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
---
 drivers/usb/gadget/omap_udc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index a2db0e1..351cb24 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -2800,7 +2800,7 @@ omap_udc_setup(struct platform_device *odev, struct otg_transceiver *xceiv)
 	return 0;
 }
 
-static int __init omap_udc_probe(struct platform_device *pdev)
+static int __devinit omap_udc_probe(struct platform_device *pdev)
 {
 	int			status = -ENODEV;
 	int			hmc;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move vesafb's probe function to .devinit.text
  2009-07-11 20:53                                                                                                         ` [PATCH] move omap_udc's " Uwe Kleine-König
@ 2009-07-11 20:53                                                                                                           ` Uwe Kleine-König
  2009-07-11 20:53                                                                                                             ` [PATCH] move vfb's " Uwe Kleine-König
  2009-07-11 22:30                                                                                                           ` [PATCH] move omap_udc's " David Brownell
  1 sibling, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:53 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Helge Deller, James Simmons, Andrew Morton, Antonino Daplas

A pointer to vesafb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Helge Deller <deller@gmx.de>
Cc: James Simmons <jsimmons@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Antonino Daplas <adaplas@pol.net>
---
 drivers/video/vesafb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index bd37ee1..ef4128c 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -226,7 +226,7 @@ static int __init vesafb_setup(char *options)
 	return 0;
 }
 
-static int __init vesafb_probe(struct platform_device *dev)
+static int __devinit vesafb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int i, err;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move vfb's probe function to .devinit.text
  2009-07-11 20:53                                                                                                           ` [PATCH] move vesafb's " Uwe Kleine-König
@ 2009-07-11 20:53                                                                                                             ` Uwe Kleine-König
  2009-07-11 20:53                                                                                                               ` [PATCH] move vga16fb's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:53 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Frans Pop, Antonino Daplas, Krzysztof Helt, Andrew Morton

A pointer to vfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Frans Pop <elendil@planet.nl>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/vfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index 050d432..b8ab995 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -479,7 +479,7 @@ static int __init vfb_setup(char *options)
      *  Initialisation
      */
 
-static int __init vfb_probe(struct platform_device *dev)
+static int __devinit vfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int retval = -ENOMEM;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move vga16fb's probe function to .devinit.text
  2009-07-11 20:53                                                                                                             ` [PATCH] move vfb's " Uwe Kleine-König
@ 2009-07-11 20:53                                                                                                               ` Uwe Kleine-König
  2009-07-11 20:53                                                                                                                 ` [PATCH] move w100fb's " Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:53 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Krzysztof Helt, Roel Kluin, Antonino Daplas, Andrew Morton

A pointer to vga16fb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Antonino Daplas <adaplas@pol.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/vga16fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
index 5b29389..76d8dae 100644
--- a/drivers/video/vga16fb.c
+++ b/drivers/video/vga16fb.c
@@ -1293,7 +1293,7 @@ static int vga16fb_setup(char *options)
 }
 #endif
 
-static int __init vga16fb_probe(struct platform_device *dev)
+static int __devinit vga16fb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct vga16fb_par *par;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move w100fb's probe function to .devinit.text
  2009-07-11 20:53                                                                                                               ` [PATCH] move vga16fb's " Uwe Kleine-König
@ 2009-07-11 20:53                                                                                                                 ` Uwe Kleine-König
  2009-07-11 20:53                                                                                                                   ` [PATCH] move xtsonic's " Uwe Kleine-König
  2009-07-11 22:26                                                                                                                   ` [PATCH] move w100fb's " Ian molton
  0 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:53 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Philipp Zabel, Ian Molton, Richard Purdie, Antonino Daplas,
	Alberto Mardegan, Andrew Morton

A pointer to w100fb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Cc: Ian Molton <spyro@f2s.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Alberto Mardegan <mardy@users.sourceforge.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/w100fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
index 2376f68..5d22395 100644
--- a/drivers/video/w100fb.c
+++ b/drivers/video/w100fb.c
@@ -628,7 +628,7 @@ static int w100fb_resume(struct platform_device *dev)
 #endif
 
 
-int __init w100fb_probe(struct platform_device *pdev)
+int __devinit w100fb_probe(struct platform_device *pdev)
 {
 	int err = -EIO;
 	struct w100fb_mach_info *inf;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] move xtsonic's probe function to .devinit.text
  2009-07-11 20:53                                                                                                                 ` [PATCH] move w100fb's " Uwe Kleine-König
@ 2009-07-11 20:53                                                                                                                   ` Uwe Kleine-König
  2009-07-11 22:26                                                                                                                   ` [PATCH] move w100fb's " Ian molton
  1 sibling, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:53 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Chris Zankel, David S. Miller, Andrew Morton

A pointer to xtsonic_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Chris Zankel <chris@zankel.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/net/xtsonic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/xtsonic.c b/drivers/net/xtsonic.c
index 5a4ad15..0c44135 100644
--- a/drivers/net/xtsonic.c
+++ b/drivers/net/xtsonic.c
@@ -239,7 +239,7 @@ out:
  * Actually probing is superfluous but we're paranoid.
  */
 
-int __init xtsonic_probe(struct platform_device *pdev)
+int __devinit xtsonic_probe(struct platform_device *pdev)
 {
 	struct net_device *dev;
 	struct sonic_local *lp;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* Re: [PATCH] move w100fb's probe function to .devinit.text
  2009-07-11 20:53                                                                                                                 ` [PATCH] move w100fb's " Uwe Kleine-König
  2009-07-11 20:53                                                                                                                   ` [PATCH] move xtsonic's " Uwe Kleine-König
@ 2009-07-11 22:26                                                                                                                   ` Ian molton
  1 sibling, 0 replies; 197+ messages in thread
From: Ian molton @ 2009-07-11 22:26 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Philipp Zabel, Richard Purdie,
	Antonino Daplas, Alberto Mardegan, Andrew Morton


Acked-by: Ian Molton <ian@mnementh.co.uk>

Uwe Kleine-König wrote:
> A pointer to w100fb_probe is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Philipp Zabel <philipp.zabel@gmail.com>
> Cc: Ian Molton <spyro@f2s.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Cc: Antonino Daplas <adaplas@gmail.com>
> Cc: Alberto Mardegan <mardy@users.sourceforge.net>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> ---
>  drivers/video/w100fb.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
> index 2376f68..5d22395 100644
> --- a/drivers/video/w100fb.c
> +++ b/drivers/video/w100fb.c
> @@ -628,7 +628,7 @@ static int w100fb_resume(struct platform_device *dev)
>  #endif
>  
>  
> -int __init w100fb_probe(struct platform_device *pdev)
> +int __devinit w100fb_probe(struct platform_device *pdev)
>  {
>  	int err = -EIO;
>  	struct w100fb_mach_info *inf;


^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move at91_ether's probe function to .devinit.text
  2009-07-11 20:52                                     ` [PATCH] move at91_ether's " Uwe Kleine-König
  2009-07-11 20:52                                       ` [PATCH] move cfag12864bfb's " Uwe Kleine-König
@ 2009-07-11 22:27                                       ` David Brownell
  2009-07-21 20:11                                         ` [PATCH] register at91_ether using platform_driver_probe Uwe Kleine-König
  1 sibling, 1 reply; 197+ messages in thread
From: David Brownell @ 2009-07-11 22:27 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, David S. Miller, David Brownell,
	Jeff Garzik, Paulius Zaleckas, Marc Pignat, Andrew Victor,
	Roel Kluin, Andrew Morton

On Saturday 11 July 2009, Uwe Kleine-König wrote:
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.

And that's the preferred fix I was expecting to see.

NAK on this version.



^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move mmci-omap-hs's probe function to .devinit.text
  2009-07-11 20:52                                                                               ` [PATCH] move mmci-omap-hs's " Uwe Kleine-König
  2009-07-11 20:52                                                                                 ` [PATCH] move orion_nand's " Uwe Kleine-König
@ 2009-07-11 22:29                                                                                 ` David Brownell
  2009-07-21 20:36                                                                                   ` [PATCH] register mmci-omap-hs using platform_driver_probe Uwe Kleine-König
  1 sibling, 1 reply; 197+ messages in thread
From: David Brownell @ 2009-07-11 22:29 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Jean Pihet, Tony Lindgren, Pierre Ossman,
	Andy Lowe, Adrian Hunter, Andrew Morton, Madhusudhan Chikkature

On Saturday 11 July 2009, Uwe Kleine-König wrote:
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.

And that's the preferred fix ... NAK on this one.

In fact its quite rare for any SoC device to be hotpluggable,
so your default stance in such cases should be to switch over
to platform_driver_probe() instead of doing like this.



^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-11 20:53                                                                                                         ` [PATCH] move omap_udc's " Uwe Kleine-König
  2009-07-11 20:53                                                                                                           ` [PATCH] move vesafb's " Uwe Kleine-König
@ 2009-07-11 22:30                                                                                                           ` David Brownell
  2009-07-12  8:35                                                                                                             ` Uwe Kleine-König
  2009-07-12 20:48                                                                                                             ` Uwe Kleine-König
  1 sibling, 2 replies; 197+ messages in thread
From: David Brownell @ 2009-07-11 22:30 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Philipp Zabel, Andrew Morton,
	Tony Lindgren, Russell King, Dmitry Baryshkov

On Saturday 11 July 2009, Uwe Kleine-König wrote:
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.

Repeat -- NAK on this.  Use platform_driver_probe() instead.

I really don't like this series of patches.  It's just adding
bloat to kernels, in chunks of up to a page per patch.



^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move sb1250-mac's probe function to .devinit.text
  2009-07-11 20:52                                                                                         ` [PATCH] move sb1250-mac's " Uwe Kleine-König
  2009-07-11 20:52                                                                                           ` [PATCH] move sgiseeq's " Uwe Kleine-König
@ 2009-07-12  0:36                                                                                           ` Maciej W. Rozycki
  1 sibling, 0 replies; 197+ messages in thread
From: Maciej W. Rozycki @ 2009-07-12  0:36 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Weiwei Wang, Jeff Garzik, David S. Miller,
	Stephen Hemminger, Andrew Morton

On Sat, 11 Jul 2009, Uwe Kleine-K?nig wrote:

> A pointer to sbmac_probe is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.
> 
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> Cc: Weiwei Wang <weiwei.wang@windriver.com>
> Cc: Jeff Garzik <jgarzik@redhat.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Stephen Hemminger <shemminger@vyatta.com>
> Cc: Maciej W. Rozycki <macro@linux-mips.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> ---
>  drivers/net/sb1250-mac.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Acked-by: Maciej W. Rozycki <macro@linux-mips.org>

 Fine by me, thanks.

  Maciej

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-11 22:30                                                                                                           ` [PATCH] move omap_udc's " David Brownell
@ 2009-07-12  8:35                                                                                                             ` Uwe Kleine-König
  2009-07-12  8:47                                                                                                               ` Russell King
  2009-07-12  9:37                                                                                                               ` David Brownell
  2009-07-12 20:48                                                                                                             ` Uwe Kleine-König
  1 sibling, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-12  8:35 UTC (permalink / raw)
  To: David Brownell
  Cc: Greg KH, linux-kernel, Philipp Zabel, Andrew Morton,
	Tony Lindgren, Russell King, Dmitry Baryshkov

Hello David,

On Sat, Jul 11, 2009 at 03:30:44PM -0700, David Brownell wrote:
> On Saturday 11 July 2009, Uwe Kleine-König wrote:
> > An alternative to this patch is using platform_driver_probe instead of
> > platform_driver_register plus removing the pointer to the probe function
> > from the struct platform_driver.
> 
> Repeat -- NAK on this.  Use platform_driver_probe() instead.
> 
> I really don't like this series of patches.  It's just adding
> bloat to kernels, in chunks of up to a page per patch.
I'm aware that in some cases platform_driver_probe is better.  But as I
don't have access to most of the affected platforms I consider it saver.
That's why I choosed this way.  The problem with platform_driver_probe
is that if a device is added only after the driver is probed the
device isn't bound.

So if you say you can test it, it's totally OK for me to go the other
way.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-12  8:35                                                                                                             ` Uwe Kleine-König
@ 2009-07-12  8:47                                                                                                               ` Russell King
  2009-07-12  9:30                                                                                                                 ` David Brownell
  2009-07-12 13:17                                                                                                                 ` Russell King
  2009-07-12  9:37                                                                                                               ` David Brownell
  1 sibling, 2 replies; 197+ messages in thread
From: Russell King @ 2009-07-12  8:47 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: David Brownell, Greg KH, linux-kernel, Philipp Zabel,
	Andrew Morton, Tony Lindgren, Dmitry Baryshkov

On Sun, Jul 12, 2009 at 10:35:10AM +0200, Uwe Kleine-König wrote:
> Hello David,
> 
> On Sat, Jul 11, 2009 at 03:30:44PM -0700, David Brownell wrote:
> > On Saturday 11 July 2009, Uwe Kleine-König wrote:
> > > An alternative to this patch is using platform_driver_probe instead of
> > > platform_driver_register plus removing the pointer to the probe function
> > > from the struct platform_driver.
> > 
> > Repeat -- NAK on this.  Use platform_driver_probe() instead.
> > 
> > I really don't like this series of patches.  It's just adding
> > bloat to kernels, in chunks of up to a page per patch.
> I'm aware that in some cases platform_driver_probe is better.  But as I
> don't have access to most of the affected platforms I consider it saver.
> That's why I choosed this way.  The problem with platform_driver_probe
> is that if a device is added only after the driver is probed the
> device isn't bound.

Your approach is perfectly fine, and safe.  You're not adding any
additional bloat which isn't already there.  If it were adding any
bloat (which it isn't), it certainly is not "in chunks of up to a
page per patch".

Overall, this patch is an improvement, so all these get my ack, and
they should be applied as is.

Using platform_driver_probe() does allow you to reduce the kernel
footprint still further, but that requires knowledge of the platforms
affected (knowing that the platform devices are present before the
drivers get probed.)

I'll apply the ones for drivers I look after later today.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-12  8:47                                                                                                               ` Russell King
@ 2009-07-12  9:30                                                                                                                 ` David Brownell
  2009-07-12 13:17                                                                                                                 ` Russell King
  1 sibling, 0 replies; 197+ messages in thread
From: David Brownell @ 2009-07-12  9:30 UTC (permalink / raw)
  To: Russell King, Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Philipp Zabel, Andrew Morton,
	Tony Lindgren, Dmitry Baryshkov

On Sunday 12 July 2009, Russell King wrote:
> Your approach is perfectly fine, and safe.  You're not adding any
> additional bloat which isn't already there.

He is most certainly increasing the runtime footprint needessly.
Runtime footprint which previously was *NOT* present.

That's known as "bloat".

And also known as "adding".


> If it were adding any 
> bloat (which it isn't), it certainly is not "in chunks of up to a
> page per patch".

Oddly, the init section of the $SUBJECT driver is about 3600 bytes.
That's what ... almost a (4K) page, wouldn't you say?

It's got a lot of one-time hardware init that was explicitly pushed
into the init section so it would stay out of the runtime image.


> Overall, this patch is an improvement, so all these get my ack, and
> they should be applied as is.

The $SUBJECT patch is most certainly NOT an improvement.

It still has a solid NAK, since it's adding almost a page of bloat.

 
> Using platform_driver_probe() does allow you to reduce the kernel
> footprint still further, but that requires knowledge of the platforms
> affected (knowing that the platform devices are present before the
> drivers get probed.)

And as I've pointed out before ... that's exactly how platform
drivers work on most platforms.  Very specifically, I've pointed
out previously to Uwe, it's how the OMAP code works.

So it's kind of perplexing to still see patches sent along which
make the situation worse.



^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-12  8:35                                                                                                             ` Uwe Kleine-König
  2009-07-12  8:47                                                                                                               ` Russell King
@ 2009-07-12  9:37                                                                                                               ` David Brownell
  1 sibling, 0 replies; 197+ messages in thread
From: David Brownell @ 2009-07-12  9:37 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Philipp Zabel, Andrew Morton,
	Tony Lindgren, Russell King, Dmitry Baryshkov

On Sunday 12 July 2009, Uwe Kleine-König wrote:
> 
> > Repeat -- NAK on this.  Use platform_driver_probe() instead.
> > 
> > I really don't like this series of patches.  It's just adding
> > bloat to kernels, in chunks of up to a page per patch.
>
> I'm aware that in some cases platform_driver_probe is better.

Make that "most cases".  It's rare that platform devices get
hotplugged.  Mostly they're set up at system init ... often
it's all done by the time arch_initcall() finishes.


> But as I 
> don't have access to most of the affected platforms I consider it saver.
> That's why I choosed this way.

You do have access to the source tree, and a powerful little
tool called "grep -r" ... which can easily tell you where the
devices for those platforms are defined.  And thus let you see
if a given one happens to be one of the exceptional cases where
platform_driver_probe() won't work.


> The problem with platform_driver_probe 
> is that if a device is added only after the driver is probed the
> device isn't bound.

That's rarely a problem though; it certainly isn't in the case of
the $SUBJECT driver, and others on that platform.  I've pointed
that out to you before.




^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-12  8:47                                                                                                               ` Russell King
  2009-07-12  9:30                                                                                                                 ` David Brownell
@ 2009-07-12 13:17                                                                                                                 ` Russell King
  2009-07-12 20:07                                                                                                                   ` David Brownell
  2009-07-12 22:21                                                                                                                   ` David Brownell
  1 sibling, 2 replies; 197+ messages in thread
From: Russell King @ 2009-07-12 13:17 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: David Brownell, Greg KH, linux-kernel, Philipp Zabel,
	Andrew Morton, Tony Lindgren, Dmitry Baryshkov

On Sun, Jul 12, 2009 at 09:47:34AM +0100, Russell King wrote:
> Your approach is perfectly fine, and safe.  You're not adding any
> additional bloat which isn't already there.  If it were adding any
> bloat (which it isn't), it certainly is not "in chunks of up to a
> page per patch".

Here is the effect of applying the am79c961 patch:

   text    data     bss     dec     hex filename
2553829   76608   78560 2708997  295605 vmlinux.patched
2553285   76608   78560 2708453  2953e5 vmlinux

that's an extra 500 bytes, but wait a moment before criticising that.
Let's look at where these came from:

before:
  1 .text.head    00000240  c0008000  c0008000  00010000  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .init         00016dc0  c0008240  c0008240  00010240  2**5
                  CONTENTS, ALLOC, LOAD, CODE
  3 .text         002455a4  c001f000  c001f000  00027000  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  4 __ksymtab     00004198  c0265000  c0265000  0026d000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA

after:
  1 .text.head    00000240  c0008000  c0008000  00010000  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .init         00016dc0  c0008240  c0008240  00010240  2**5
                  CONTENTS, ALLOC, LOAD, CODE
  3 .text         002457c4  c001f000  c001f000  00027000  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  4 __ksymtab     00004198  c0265000  c0265000  0026d000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA

Notice that the VMA of __ksymtab hasn't changed, which follows on from
the text section.  What's happened is that we've merely moved some text
from the .init section to the .text section, and in this case we haven't
changed the overall file size, nor the number of pages used for each
section.

To nack these patches based upon every patch adding one page to the kernel
size is clearly overstating the effect.  The effect is that in some
configurations, it moves some text out of .init into .text, and can
increase the size of the kernel kept in memory after boot time.  It's
certainly no where near "one page per patch" though, and the overall
size of the kernel may only change +/- one page through doing this -
eg, you might move enough text out of .init so that shrinks by one
page without making .text expand by a page.

I don't think this is a strong enough reason to reject any of these
patches.  David's approach is an enhancement whereas your patches
are a bug fix.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-12 13:17                                                                                                                 ` Russell King
@ 2009-07-12 20:07                                                                                                                   ` David Brownell
  2009-07-12 22:21                                                                                                                   ` David Brownell
  1 sibling, 0 replies; 197+ messages in thread
From: David Brownell @ 2009-07-12 20:07 UTC (permalink / raw)
  To: Russell King
  Cc: Uwe Kleine-König, Greg KH, linux-kernel, Philipp Zabel,
	Andrew Morton, Tony Lindgren, Dmitry Baryshkov

On Sunday 12 July 2009, Russell King wrote:
> Here is the effect of applying the am79c961 patch:

Observe:  $SUBJECT is an entirely separate patch.

My NAKs were quite specific.


^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-11 22:30                                                                                                           ` [PATCH] move omap_udc's " David Brownell
  2009-07-12  8:35                                                                                                             ` Uwe Kleine-König
@ 2009-07-12 20:48                                                                                                             ` Uwe Kleine-König
  2009-07-12 22:12                                                                                                               ` David Brownell
  2009-07-13  9:12                                                                                                               ` [PATCH] don't add clevo_mail_led_driver's probe function to the driver struct Uwe Kleine-König
  1 sibling, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-12 20:48 UTC (permalink / raw)
  To: David Brownell
  Cc: Greg KH, linux-kernel, Philipp Zabel, Andrew Morton,
	Tony Lindgren, Russell King, Dmitry Baryshkov

On Sat, Jul 11, 2009 at 03:30:44PM -0700, David Brownell wrote:
> On Saturday 11 July 2009, Uwe Kleine-König wrote:
> > An alternative to this patch is using platform_driver_probe instead of
> > platform_driver_register plus removing the pointer to the probe function
> > from the struct platform_driver.
> 
> Repeat -- NAK on this.  Use platform_driver_probe() instead.
Oh, I just noticed that this patch is a relict.  The driver was changed
to use platform_driver_probe in
864e28b4f24106b799e991fa136fa6fa2b638a68.

As my old patch just applied anyhow I didn't notice that.

And I just found another similar problem.
E.g. clevo_mail_led_probe is defined to live in .init.text and uses
platform_driver_probe, but as it's referenced in the driver struct my
script matched this file.

(Is it wrong (wrong as in "worth to be fixed") to reference the probe
function in the driver struct when platform_driver_probe is used?  If so
at least

	drivers/serial/msm_serial.c
	drivers/i2c/busses/i2c-imx.c

are effected, too.  Patches at

	http://news.gmane.org/find-root.php?group=gmane.linux.ports.arm.kernel&article=62319

)

The other patches are not affected.

@Greg:  Please just drop these two patches:

	[PATCH] move omap_udc's probe function to .devinit.text
	[PATCH] move leds-clevo-mail's probe function to .devinit.text

Sorry for the unconvenience.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-12 20:48                                                                                                             ` Uwe Kleine-König
@ 2009-07-12 22:12                                                                                                               ` David Brownell
  2009-07-13  9:12                                                                                                               ` [PATCH] don't add clevo_mail_led_driver's probe function to the driver struct Uwe Kleine-König
  1 sibling, 0 replies; 197+ messages in thread
From: David Brownell @ 2009-07-12 22:12 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Philipp Zabel, Andrew Morton,
	Tony Lindgren, Russell King, Dmitry Baryshkov

On Sunday 12 July 2009, Uwe Kleine-König wrote:
> On Sat, Jul 11, 2009 at 03:30:44PM -0700, David Brownell wrote:
> > Repeat -- NAK on this.  Use platform_driver_probe() instead.
>
> Oh, I just noticed that this patch is a relict.  The driver was changed
> to use platform_driver_probe in
> 864e28b4f24106b799e991fa136fa6fa2b638a68.

Good.
 

> And I just found another similar problem.
> E.g. clevo_mail_led_probe is defined to live in .init.text and uses
> platform_driver_probe, but as it's referenced in the driver struct my
> script matched this file.
> 
> (Is it wrong (wrong as in "worth to be fixed") to reference the probe
> function in the driver struct when platform_driver_probe is used?

Wrong, but not dangerous ... so fix, but at low priority.
At least, low until the DEBUG_SECTION_MISMATCH stuff gets
re-enabled.

When platform_driver_probe() returns, that driver field willl
have changed to something safe.


> If so 
> at least
> 
> 	drivers/serial/msm_serial.c
> 	drivers/i2c/busses/i2c-imx.c
> 
> are effected, too.  Patches at
> 
> 	http://news.gmane.org/find-root.php?group=gmane.linux.ports.arm.kernel&article=62319
> 
> )
> 
> The other patches are not affected.
> 
> @Greg:  Please just drop these two patches:
> 
> 	[PATCH] move omap_udc's probe function to .devinit.text
> 	[PATCH] move leds-clevo-mail's probe function to .devinit.text

... and the others I NAKed too.


> 
> Sorry for the unconvenience.
> 
> Best regards
> Uwe
> 
> -- 
> Pengutronix e.K.                              | Uwe Kleine-König            |
> Industrial Linux Solutions                    | http://www.pengutronix.de/  |
> 
> 



^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-12 13:17                                                                                                                 ` Russell King
  2009-07-12 20:07                                                                                                                   ` David Brownell
@ 2009-07-12 22:21                                                                                                                   ` David Brownell
  2009-07-13  9:10                                                                                                                     ` Uwe Kleine-König
  1 sibling, 1 reply; 197+ messages in thread
From: David Brownell @ 2009-07-12 22:21 UTC (permalink / raw)
  To: Russell King
  Cc: Uwe Kleine-König, Greg KH, linux-kernel, Philipp Zabel,
	Andrew Morton, Tony Lindgren, Dmitry Baryshkov

On Sunday 12 July 2009, Russell King wrote:
> 	 David's approach is an enhancement whereas your patches
> are a bug fix.

Not an enhancement.  Uwe's current approach causes regressions
in terms of kernel runtime footprint.  That is, pages will newly
be made to sit around doing *nothing* forever, when they could
have been used to get Real Work done.  And, pre-patches, they
would have been getting Real Work done.

If it weren't a regression I wouldn't have objected.

A few years back, I measured the impact of having probe() and
friends in a section -- init{,data} vs devinit{,data} -- that gets
removed.  Most drivers were in the 1K-2K range.  $SUBJECT was
larger than most, but there were some with even more discardable
init logic.

All that adds up.  There's no point to commiting patches that
do things wrong *and* waste space, then need to fix things up
again later when it's easy to do it right in the first place.



^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move corgi-ssp's probe function to .devinit.text
  2009-07-11 20:52                                             ` [PATCH] move corgi-ssp's " Uwe Kleine-König
  2009-07-11 20:52                                               ` [PATCH] move efifb's " Uwe Kleine-König
@ 2009-07-13  8:44                                               ` Eric Miao
  2009-07-13  9:01                                                 ` Uwe Kleine-König
  1 sibling, 1 reply; 197+ messages in thread
From: Eric Miao @ 2009-07-13  8:44 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Eric Miao, Russell King, Paul Sokolovsky,
	Richard Purdie, Liam Girdwood, Andrew Morton

Uwe Kleine-König wrote:
> A pointer to corgi_ssp_probe is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (when having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.
> 

This corgi_ssp.c and corgi_lcd.c will be obsoleted soon, the only user
corgi_ts.c has been marked as deprecated, and will be remove once the
ssp cleanup work is done, so further fixes to these files are pointless.

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move corgi-ssp's probe function to .devinit.text
  2009-07-13  8:44                                               ` [PATCH] move corgi-ssp's " Eric Miao
@ 2009-07-13  9:01                                                 ` Uwe Kleine-König
  0 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-13  9:01 UTC (permalink / raw)
  To: Eric Miao
  Cc: Greg KH, linux-kernel, Eric Miao, Russell King, Paul Sokolovsky,
	Richard Purdie, Liam Girdwood, Andrew Morton

On Mon, Jul 13, 2009 at 04:44:01PM +0800, Eric Miao wrote:
> Uwe Kleine-König wrote:
> > A pointer to corgi_ssp_probe is passed to the core via
> > platform_driver_register and so the function must not disappear when the
> > .init sections are discarded.  Otherwise (when having HOTPLUG=y)
> > unbinding and binding a device to the driver via sysfs will result in an
> > oops as does a device being registered late.
> > 
> > An alternative to this patch is using platform_driver_probe instead of
> > platform_driver_register plus removing the pointer to the probe function
> > from the struct platform_driver.
> > 
> 
> This corgi_ssp.c and corgi_lcd.c will be obsoleted soon, the only user
> corgi_ts.c has been marked as deprecated, and will be remove once the
> ssp cleanup work is done, so further fixes to these files are pointless.
OK, dropped.  I hope that either the drivers will be gone when I respin
this series or I still remember having dropped the patches :-)

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-12 22:21                                                                                                                   ` David Brownell
@ 2009-07-13  9:10                                                                                                                     ` Uwe Kleine-König
  2009-07-13 21:31                                                                                                                       ` David Brownell
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-13  9:10 UTC (permalink / raw)
  To: David Brownell
  Cc: Russell King, Greg KH, linux-kernel, Philipp Zabel,
	Andrew Morton, Tony Lindgren, Dmitry Baryshkov

Hello David,

On Sun, Jul 12, 2009 at 03:21:30PM -0700, David Brownell wrote:
> On Sunday 12 July 2009, Russell King wrote:
> > 	 David's approach is an enhancement whereas your patches
> > are a bug fix.
> 
> Not an enhancement.  Uwe's current approach causes regressions
> in terms of kernel runtime footprint.  That is, pages will newly
> be made to sit around doing *nothing* forever, when they could
> have been used to get Real Work done.  And, pre-patches, they
> would have been getting Real Work done.
> 
> If it weren't a regression I wouldn't have objected.
IMHO my patches primarily fix possible oopses.  I see your point that
platform_driver_probe has some advantages, but I consider it too
time-consuming to check for each of the initially 60+ patches when the
respecting devices are registered.

My intention is to point out a problem plus provide a safe fix.

> All that adds up.  There's no point to commiting patches that
> do things wrong *and* waste space, then need to fix things up
> again later when it's easy to do it right in the first place.

Obviously it's arguable if it's wrong or not.  I consider it at least
better than doing nothing.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* [PATCH] don't add clevo_mail_led_driver's probe function to the driver struct
  2009-07-12 20:48                                                                                                             ` Uwe Kleine-König
  2009-07-12 22:12                                                                                                               ` David Brownell
@ 2009-07-13  9:12                                                                                                               ` Uwe Kleine-König
  1 sibling, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-13  9:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Márton Németh, Richard Purdie

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1336 bytes --]

clevo_mail_led_driver is registered using platform_driver_probe which
takes care for the probe function itself.  So don't pass it in the
driver struct, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Márton Németh <nm127@freemail.hu>
Cc: Richard Purdie <rpurdie@rpsys.net>
---
Hello,

I'm a bit uncertain if this patch is really useful.  There is no
difference in runtime behaviour because platform_driver_probe just
overwrites the .probe member.  Nevertheless it's a section violation
that hurts my eye and triggers a false positive for my script that finds
drivers using probe functions in .init.text and
platform_driver_register.

Care?  Don't care?

Best regards
Uwe

 drivers/leds/leds-clevo-mail.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/leds/leds-clevo-mail.c b/drivers/leds/leds-clevo-mail.c
index 1813c84..5b36ae2 100644
--- a/drivers/leds/leds-clevo-mail.c
+++ b/drivers/leds/leds-clevo-mail.c
@@ -157,7 +157,6 @@ static int clevo_mail_led_remove(struct platform_device *pdev)
 }
 
 static struct platform_driver clevo_mail_led_driver = {
-	.probe		= clevo_mail_led_probe,
 	.remove		= clevo_mail_led_remove,
 	.driver		= {
 		.name		= KBUILD_MODNAME,
-- 
tg: (7638d53..) t/noprobecbforplatformdriverprobe/clevo_mail_led_driver (depends on: linus/master)

^ permalink raw reply related	[flat|nested] 197+ messages in thread

* Re: [PATCH] move efifb's probe function to .devinit.text
  2009-07-11 20:52                                               ` [PATCH] move efifb's " Uwe Kleine-König
  2009-07-11 20:52                                                 ` [PATCH] move epson1355fb's " Uwe Kleine-König
@ 2009-07-13 13:51                                                 ` Peter Jones
  1 sibling, 0 replies; 197+ messages in thread
From: Peter Jones @ 2009-07-13 13:51 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Krzysztof Helt, Geert Uytterhoeven,
	Jaya Kumar, Ralf Baechle, Maciej W. Rozycki, Andrew Morton,
	Chandramouli Narayanan, Huang Ying

On 07/11/2009 04:52 PM, Uwe Kleine-König wrote:
> A pointer to efifb_probe is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.

Looks good to me:

Acked-by: Peter Jones <pjones@redhat.com>

> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Peter Jones <pjones@redhat.com>
> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
> Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
> Cc: Jaya Kumar <jayakumar.lkml@gmail.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Maciej W. Rozycki <macro@linux-mips.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Chandramouli Narayanan <mouli@linux.intel.com>
> Cc: Huang Ying <ying.huang@intel.com>
> ---
>  drivers/video/efifb.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
> index eb12182..2161f21 100644
> --- a/drivers/video/efifb.c
> +++ b/drivers/video/efifb.c
> @@ -201,7 +201,7 @@ static int __init efifb_setup(char *options)
>  	return 0;
>  }
>  
> -static int __init efifb_probe(struct platform_device *dev)
> +static int __devinit efifb_probe(struct platform_device *dev)
>  {
>  	struct fb_info *info;
>  	int err;


-- 
        Peter

In computer science, about the only thing we can prove is that traveling
salesmen can't find their way from one place to another effeciently, and
that unix hackers can't really decode 40-bit keys by harnessing all the
computers in the lab.  And the hackers do it anyway, and the salesmen still
make their rounds.
		-- Ron Jeffries, WikiWikiWeb

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move orion_nand's probe function to .devinit.text
  2009-07-11 20:52                                                                                 ` [PATCH] move orion_nand's " Uwe Kleine-König
  2009-07-11 20:52                                                                                   ` [PATCH] move q40fb's " Uwe Kleine-König
@ 2009-07-13 19:37                                                                                   ` Nicolas Pitre
  2009-07-14  8:09                                                                                     ` Uwe Kleine-König
  1 sibling, 1 reply; 197+ messages in thread
From: Nicolas Pitre @ 2009-07-13 19:37 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Lennert Buijtenhek, Saeed Bishara,
	Jörn Engel, Andrew Morton

[-- Attachment #1: Type: TEXT/PLAIN, Size: 631 bytes --]

On Sat, 11 Jul 2009, Uwe Kleine-König wrote:

> A pointer to orion_nand_probe is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.

For those kind of platform devices I'd prefer the alternative.


Nicolas

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move omap_udc's probe function to .devinit.text
  2009-07-13  9:10                                                                                                                     ` Uwe Kleine-König
@ 2009-07-13 21:31                                                                                                                       ` David Brownell
  0 siblings, 0 replies; 197+ messages in thread
From: David Brownell @ 2009-07-13 21:31 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Russell King, Greg KH, linux-kernel, Philipp Zabel,
	Andrew Morton, Tony Lindgren, Dmitry Baryshkov

On Monday 13 July 2009, Uwe Kleine-König wrote:
> > If it weren't a regression I wouldn't have objected.
> 
> IMHO my patches primarily fix possible oopses.  I see your point that
> platform_driver_probe has some advantages, 

The point is that your specific change caused a type
of regresssion ... I said nothing about "advantages",
just that your approach creates footprint regressions.


> 			but I consider it too
> time-consuming to check for each of the initially 60+ patches when the
> respecting devices are registered.

As a rule, preventing regressions is part of the task
description for any patch series.

Now, accidents do happen.  But you had *ALREADY* gotten
NAKs for many of these patches, specifically on the
basis that they were causing these regressions.  You
saved zero time by re-submitting known-broken patches.


^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move orion_nand's probe function to .devinit.text
  2009-07-13 19:37                                                                                   ` [PATCH] move orion_nand's " Nicolas Pitre
@ 2009-07-14  8:09                                                                                     ` Uwe Kleine-König
  2009-07-14 16:12                                                                                       ` Nicolas Pitre
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-14  8:09 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: Greg KH, linux-kernel, Lennert Buijtenhek, Saeed Bishara,
	Jörn Engel, Andrew Morton

Hi Nicolas,

On Mon, Jul 13, 2009 at 03:37:23PM -0400, Nicolas Pitre wrote:
> On Sat, 11 Jul 2009, Uwe Kleine-König wrote:
> 
> > A pointer to orion_nand_probe is passed to the core via
> > platform_driver_register and so the function must not disappear when the
> > .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> > unbinding and binding a device to the driver via sysfs will result in an
> > oops as does a device being registered late.
> > 
> > An alternative to this patch is using platform_driver_probe instead of
> > platform_driver_register plus removing the pointer to the probe function
> > from the struct platform_driver.
> 
> For those kind of platform devices I'd prefer the alternative.
Can I interpret that as your intend to implement and test it?

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move orion_nand's probe function to .devinit.text
  2009-07-14  8:09                                                                                     ` Uwe Kleine-König
@ 2009-07-14 16:12                                                                                       ` Nicolas Pitre
  2009-07-14 17:17                                                                                         ` Uwe Kleine-König
  2009-07-21 20:46                                                                                           ` Uwe Kleine-König
  0 siblings, 2 replies; 197+ messages in thread
From: Nicolas Pitre @ 2009-07-14 16:12 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Lennert Buijtenhek, Saeed Bishara,
	Jörn Engel, Andrew Morton

[-- Attachment #1: Type: TEXT/PLAIN, Size: 934 bytes --]

On Tue, 14 Jul 2009, Uwe Kleine-König wrote:

> Hi Nicolas,
> 
> On Mon, Jul 13, 2009 at 03:37:23PM -0400, Nicolas Pitre wrote:
> > On Sat, 11 Jul 2009, Uwe Kleine-König wrote:
> > 
> > > A pointer to orion_nand_probe is passed to the core via
> > > platform_driver_register and so the function must not disappear when the
> > > .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> > > unbinding and binding a device to the driver via sysfs will result in an
> > > oops as does a device being registered late.
> > > 
> > > An alternative to this patch is using platform_driver_probe instead of
> > > platform_driver_register plus removing the pointer to the probe function
> > > from the struct platform_driver.
> > 
> > For those kind of platform devices I'd prefer the alternative.
> Can I interpret that as your intend to implement and test it?

"Eventually", yes.  This is however a low priority for me.


Nicolas

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move orion_nand's probe function to .devinit.text
  2009-07-14 16:12                                                                                       ` Nicolas Pitre
@ 2009-07-14 17:17                                                                                         ` Uwe Kleine-König
  2009-07-21 20:46                                                                                           ` Uwe Kleine-König
  1 sibling, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-14 17:17 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: Greg KH, linux-kernel, Lennert Buijtenhek, Saeed Bishara,
	Jörn Engel, Andrew Morton

Hi Nicolas,

On Tue, Jul 14, 2009 at 12:12:46PM -0400, Nicolas Pitre wrote:
> > > > An alternative to this patch is using platform_driver_probe instead of
> > > > platform_driver_register plus removing the pointer to the probe function
> > > > from the struct platform_driver.
> > > 
> > > For those kind of platform devices I'd prefer the alternative.
> > Can I interpret that as your intend to implement and test it?
> 
> "Eventually", yes.  This is however a low priority for me.
For me, too.  I just keep the patch in my queue that it doesn't get
dropped.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-07-11 20:46                               ` Uwe Kleine-König
@ 2009-07-16 22:58                                 ` Greg KH
  2009-07-17  8:34                                   ` Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Greg KH @ 2009-07-16 22:58 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Greg KH, linux-kernel

On Sat, Jul 11, 2009 at 10:46:31PM +0200, Uwe Kleine-König wrote:
> Hello Greg,
> 
> On Sat, Jul 11, 2009 at 11:59:20AM -0700, Greg KH wrote:
> > On Sat, Jul 11, 2009 at 12:00:14PM +0200, Uwe Kleine-König wrote:
> > > Hi Greg,
> > > 
> > > > > Are you conviced and took the patch or did you give up to convince me?
> > > > 
> > > > Heh, no, sorry, it got burried in my queue.
> > > > 
> > > > > I still think the patch is correct and I'd like to have it applied.
> > > > 
> > > > Ok, let's test it out in the linux-next tree for a while to make sure it
> > > > works properly.  Care to send me an updated version?
> > > I updated to latest Linus' master.  It applies to linux-next from
> > > Fri Jul 10 14:44:30 2009 +1000 as is.
> > > 
> > > Back some time I sent a series that fixes many of these bugs.  I will
> > > update it later today and resend.
> > > 
> > > Best regards and thanks,
> > > Uwe
> > > 
> > > ---->8----
> > > From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > Subject: [PATCH] platform_driver_register:  warn if probe is in .init.text
> > > 
> > > with HOTPLUG=y it's wrong to register a platform_driver whose probe
> > > function lives in .init.text because the probe function can be called
> > > (e.g. via sysfs or by registering a device late) after the init sections
> > > are already discarded.  This results in an oops.
> > > 
> > > So warn if such a driver is registered.
> > > 
> > > Without HOTPLUG the probe function can (and should) be discarded if the
> > > driver is registered while the init sections are still available.
> > > In this case warn if the probe function isn't discarded later.  (As
> > > described in the comments there is a small chance for a wrong warning.
> > > But as HOTPLUG=n is unusual today and the situation is strage enough to
> > > be cleaned up anyhow, I think this is OK.)
> > > 
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > 
> > This code kills the build in very bad ways :(
> it's just a ; that didn't made it into the new version.  Don't know why.
> 
> If you squash the patch below into the patch I sent it should work
> again.

I don't have the original anymore :(

As it seemed that a lot of people who controlled the problem drivers
didn't like the patches, what are you considering doing now?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-07-16 22:58                                 ` Greg KH
@ 2009-07-17  8:34                                   ` Uwe Kleine-König
  0 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-17  8:34 UTC (permalink / raw)
  To: Greg KH; +Cc: Greg KH, linux-kernel

Hello Greg,

> > > This code kills the build in very bad ways :(
> > it's just a ; that didn't made it into the new version.  Don't know why.
> > 
> > If you squash the patch below into the patch I sent it should work
> > again.
> 
> I don't have the original anymore :(
See below.  I changed the wording of the output in the !HOTPLUG case to
say .devinit.text instead of .init.text and fixed a typo in the commit
log.  Other than that the patch is unchanged.
 
> As it seemed that a lot of people who controlled the problem drivers
> didn't like the patches, what are you considering doing now?
Hmm, there are only two people that expressed not being completly happy
with my suggestions.

I think I will just drop the a patches for now and later just point out
the problem.  (At least for David's nacked drivers I feel little urge to
implement the alternative fix.)

And maybe if the "warn if probe is in .init.text" patch is merged the
people seeing the problem become more numerous which I hope will either
increase the positive feedback for the other patches or someone else
will propose a patch implementing the alternative.  (Maybe I should just
BUG() instead of only printing a warning :-)

Best regards and thanks for your ping on the subject
Uwe

--->8---
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Subject: platform_driver_register:  warn if probe is in .init.text

with HOTPLUG=y it's wrong to register a platform_driver who's probe
function lives in .init.text because the probe function can be called
(e.g. via sysfs or by registering a device late) after the init sections
are already discarded.  This results in an oops.

So warn if such a driver is registered.

Without HOTPLUG the probe function can (and should) be discarded if the
driver is registered while the init sections are still available.
In this case warn if the probe function isn't discarded later.  (As
described in the comments there is a small chance for a wrong warning.
But as HOTPLUG=n is unusual today and the situation is strage enough to
be cleaned up anyhow, I think this is OK.)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/base/platform.c |   43 +++++++++++++++++++++++++++++++++++++------
 include/linux/kernel.h  |    2 ++
 include/linux/module.h  |   12 ++++++++++++
 kernel/extable.c        |   12 ++++++++++++
 kernel/module.c         |   36 ++++++++++++++++++++++++++++++++++++
 5 files changed, 99 insertions(+), 6 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 81cb01b..68ef8cc 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -470,11 +470,7 @@ static void platform_drv_shutdown(struct device *_dev)
 	drv->shutdown(dev);
 }
 
-/**
- * platform_driver_register
- * @drv: platform driver structure
- */
-int platform_driver_register(struct platform_driver *drv)
+static int __platform_driver_register(struct platform_driver *drv)
 {
 	drv->driver.bus = &platform_bus_type;
 	if (drv->probe)
@@ -489,6 +485,41 @@ int platform_driver_register(struct platform_driver *drv)
 
 	return driver_register(&drv->driver);
 }
+
+/**
+ * platform_driver_register
+ * @drv: platform driver structure
+ */
+int platform_driver_register(struct platform_driver *drv)
+{
+	int ret = __platform_driver_register(drv);
+
+#if defined(CONFIG_HOTPLUG)
+	/*
+	 * drivers that are registered by platform_driver_register
+	 * should not have their probe function in .init.text.  The
+	 * reason is that a probe can happen after .init.text is
+	 * discarded which then results in an oops.  The alternatives
+	 * are using .devinit.text for the probe function or "register"
+	 * with platform_driver_probe.
+	 */
+	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
+		pr_warning("oops-warning: probe function of platform driver %s"
+			       " lives in .init.text\n", drv->driver.name);
+#else
+	/*
+	 * without HOTPLUG probe functions can be discarded after the driver is
+	 * loaded.
+	 * There is a little chance for false positives, namely if the driver is
+	 * registered after the .init sections are discarded.
+	 */
+	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
+		pr_info("probably the probe function of platform driver %s can"
+				" be moved to .devinit.text\n",
+				drv->driver.name);
+#endif
+	return ret;
+}
 EXPORT_SYMBOL_GPL(platform_driver_register);
 
 /**
@@ -525,7 +556,7 @@ int __init_or_module platform_driver_probe(struct platform_driver *drv,
 
 	/* temporary section violation during probe() */
 	drv->probe = probe;
-	retval = code = platform_driver_register(drv);
+	retval = code = __platform_driver_register(drv);
 
 	/* Fixup that section violation, being paranoid about code scanning
 	 * the list of drivers in order to probe new devices.  Check to see
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d6320a3..2d48087 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -203,8 +203,10 @@ extern char *get_options(const char *str, int nints, int *ints);
 extern unsigned long long memparse(const char *ptr, char **retptr);
 
 extern int core_kernel_text(unsigned long addr);
+extern int core_kernel_init_text(unsigned long addr);
 extern int __kernel_text_address(unsigned long addr);
 extern int kernel_text_address(unsigned long addr);
+extern int kernel_init_text_address(unsigned long addr);
 extern int func_ptr_is_kernel_text(void *ptr);
 
 struct pid;
diff --git a/include/linux/module.h b/include/linux/module.h
index 098bdb7..93f47c4 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -385,9 +385,11 @@ static inline int module_is_live(struct module *mod)
 }
 
 struct module *__module_text_address(unsigned long addr);
+struct module *__module_init_text_address(unsigned long addr);
 struct module *__module_address(unsigned long addr);
 bool is_module_address(unsigned long addr);
 bool is_module_text_address(unsigned long addr);
+bool is_module_init_text_address(unsigned long addr);
 
 static inline int within_module_core(unsigned long addr, struct module *mod)
 {
@@ -556,6 +558,11 @@ static inline struct module *__module_text_address(unsigned long addr)
 	return NULL;
 }
 
+static inline struct module *__module_init_text_address(unsigned long addr)
+{
+	return NULL;
+}
+
 static inline bool is_module_address(unsigned long addr)
 {
 	return false;
@@ -566,6 +573,11 @@ static inline bool is_module_text_address(unsigned long addr)
 	return false;
 }
 
+static inline bool is_module_init_text_address(unsigned long addr)
+{
+	return false;
+}
+
 /* Get/put a kernel symbol (calls should be symmetric) */
 #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
 #define symbol_put(x) do { } while(0)
diff --git a/kernel/extable.c b/kernel/extable.c
index 7f8f263..bfd7bda 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -66,6 +66,11 @@ int core_kernel_text(unsigned long addr)
 	    addr <= (unsigned long)_etext)
 		return 1;
 
+	return core_kernel_init_text;
+}
+
+int core_kernel_init_text(unsigned long addr)
+{
 	if (system_state == SYSTEM_BOOTING &&
 	    init_kernel_text(addr))
 		return 1;
@@ -98,6 +103,13 @@ int kernel_text_address(unsigned long addr)
 	return is_module_text_address(addr);
 }
 
+int kernel_init_text_address(unsigned long addr)
+{
+	if (core_kernel_init_text(addr))
+		return 1;
+	return is_module_init_text_address(addr);
+}
+
 /*
  * On some architectures (PPC64, IA64) function pointers
  * are actually only tokens to some data that then holds the
diff --git a/kernel/module.c b/kernel/module.c
index 0a04983..f1fbeb0 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2890,6 +2890,22 @@ bool is_module_text_address(unsigned long addr)
 }
 
 /*
+ * is_module_init_text_address - is this address inside a module's .init.text
+ * section?
+ * @addr: the address to check.
+ */
+bool is_module_init_text_address(unsigned long addr)
+{
+	bool ret;
+
+	preempt_disable();
+	ret = __module_init_text_address(addr) != NULL;
+	preempt_enable();
+
+	return ret;
+}
+
+/*
  * __module_text_address - get the module whose code contains an address.
  * @addr: the address.
  *
@@ -2909,6 +2925,26 @@ struct module *__module_text_address(unsigned long addr)
 }
 EXPORT_SYMBOL_GPL(__module_text_address);
 
+/*
+ * __module_init_text_address - get the module whose .init.text contains an
+ * address.
+ * @addr: the address.
+ *
+ * Must be called with preempt disabled or module mutex held so that
+ * module doesn't get freed during this.
+ */
+struct module *__module_init_text_address(unsigned long addr)
+{
+	struct module *mod = __module_address(addr);
+	if (mod) {
+		/* Make sure it's within the .init.text section. */
+		if (!within(addr, mod->module_init, mod->init_text_size))
+			mod = NULL;
+	}
+	return mod;
+}
+EXPORT_SYMBOL_GPL(__module_init_text_address);
+
 /* Don't grab lock, we're oopsing. */
 void print_modules(void)
 {
-- 
1.6.3.3

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply related	[flat|nested] 197+ messages in thread

* Re: [PATCH] move macsonic's probe function to .devinit.text
  2009-07-11 20:52                                                                     ` [PATCH] move macsonic's " Uwe Kleine-König
  2009-07-11 20:52                                                                       ` [PATCH] move meth's " Uwe Kleine-König
@ 2009-07-21 15:14                                                                       ` Finn Thain
  2009-07-21 15:40                                                                         ` [PATCH] macsonic, jazzsonic - fix oops on module unload Finn Thain
                                                                                           ` (2 more replies)
  1 sibling, 3 replies; 197+ messages in thread
From: Finn Thain @ 2009-07-21 15:14 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Jeff Garzik, David S. Miller,
	Geert Uytterhoeven, Andrew Morton



On Sat, 11 Jul 2009, Uwe Kleine-K?nig wrote:

> A pointer to mac_sonic_probe is passed to the core via 
> platform_driver_register and so the function must not disappear when the 
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y) 
> unbinding and binding a device to the driver via sysfs will result in an 
> oops as does a device being registered late.

This patch works for me (tested on a Quadra 630). I still get an oops on 
rmmod, but that's a separate issue. I'll send a patch for that.

Finn

>
> Various other functions that are called by mac_sonic_probe need to move 
> to .devinit.text, too.
>
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.
>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> Cc: Jeff Garzik <jgarzik@redhat.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Finn Thain <fthain@telegraphics.com.au>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> ---
> drivers/net/macsonic.c |   14 +++++++-------
> 1 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
> index acd143d..8f492c7 100644
> --- a/drivers/net/macsonic.c
> +++ b/drivers/net/macsonic.c
> @@ -179,7 +179,7 @@ static const struct net_device_ops macsonic_netdev_ops = {
> 	.ndo_set_mac_address	= eth_mac_addr,
> };
>
> -static int __init macsonic_init(struct net_device *dev)
> +static int __devinit macsonic_init(struct net_device *dev)
> {
> 	struct sonic_local* lp = netdev_priv(dev);
>
> @@ -223,7 +223,7 @@ static int __init macsonic_init(struct net_device *dev)
> 	return 0;
> }
>
> -static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev)
> +static int __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev)
> {
> 	struct sonic_local *lp = netdev_priv(dev);
> 	const int prom_addr = ONBOARD_SONIC_PROM_BASE;
> @@ -288,7 +288,7 @@ static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev)
> 	} else return 0;
> }
>
> -static int __init mac_onboard_sonic_probe(struct net_device *dev)
> +static int __devinit mac_onboard_sonic_probe(struct net_device *dev)
> {
> 	/* Bwahahaha */
> 	static int once_is_more_than_enough;
> @@ -409,7 +409,7 @@ static int __init mac_onboard_sonic_probe(struct net_device *dev)
> 	return macsonic_init(dev);
> }
>
> -static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev,
> +static int __devinit mac_nubus_sonic_ethernet_addr(struct net_device *dev,
> 						unsigned long prom_addr,
> 						int id)
> {
> @@ -424,7 +424,7 @@ static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev,
> 	return 0;
> }
>
> -static int __init macsonic_ident(struct nubus_dev *ndev)
> +static int __devinit macsonic_ident(struct nubus_dev *ndev)
> {
> 	if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC &&
> 	    ndev->dr_sw == NUBUS_DRSW_SONIC_LC)
> @@ -449,7 +449,7 @@ static int __init macsonic_ident(struct nubus_dev *ndev)
> 	return -1;
> }
>
> -static int __init mac_nubus_sonic_probe(struct net_device *dev)
> +static int __devinit mac_nubus_sonic_probe(struct net_device *dev)
> {
> 	static int slots;
> 	struct nubus_dev* ndev = NULL;
> @@ -562,7 +562,7 @@ static int __init mac_nubus_sonic_probe(struct net_device *dev)
> 	return macsonic_init(dev);
> }
>
> -static int __init mac_sonic_probe(struct platform_device *pdev)
> +static int __devinit mac_sonic_probe(struct platform_device *pdev)
> {
> 	struct net_device *dev;
> 	struct sonic_local *lp;
>

^ permalink raw reply	[flat|nested] 197+ messages in thread

* [PATCH] macsonic, jazzsonic - fix oops on module unload
  2009-07-21 15:14                                                                       ` [PATCH] move macsonic's probe function to .devinit.text Finn Thain
@ 2009-07-21 15:40                                                                         ` Finn Thain
  2009-07-21 19:22                                                                           ` David Miller
  2009-07-21 19:20                                                                         ` [PATCH] move macsonic's probe function to .devinit.text Uwe Kleine-König
  2009-07-21 19:20                                                                         ` David Miller
  2 siblings, 1 reply; 197+ messages in thread
From: Finn Thain @ 2009-07-21 15:40 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Greg KH, Uwe Kleine-König


Set the driver data before using it. Fixes an oops when doing rmmod.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

--- a/drivers/net/macsonic.c	2009-07-22 00:47:46.000000000 +1000
+++ b/drivers/net/macsonic.c	2009-07-22 00:49:39.000000000 +1000
@@ -575,6 +575,7 @@
  	lp = netdev_priv(dev);
  	lp->device = &pdev->dev;
  	SET_NETDEV_DEV(dev, &pdev->dev);
+	platform_set_drvdata(pdev, dev);

  	/* This will catch fatal stuff like -ENOMEM as well as success */
  	err = mac_onboard_sonic_probe(dev);
--- a/drivers/net/jazzsonic.c	2009-07-22 00:47:52.000000000 +1000
+++ b/drivers/net/jazzsonic.c	2009-07-22 00:52:41.000000000 +1000
@@ -222,6 +222,7 @@
  	lp = netdev_priv(dev);
  	lp->device = &pdev->dev;
  	SET_NETDEV_DEV(dev, &pdev->dev);
+	platform_set_drvdata(pdev, dev);

  	netdev_boot_setup_check(dev);


^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move macsonic's probe function to .devinit.text
  2009-07-21 15:14                                                                       ` [PATCH] move macsonic's probe function to .devinit.text Finn Thain
  2009-07-21 15:40                                                                         ` [PATCH] macsonic, jazzsonic - fix oops on module unload Finn Thain
@ 2009-07-21 19:20                                                                         ` Uwe Kleine-König
  2009-07-21 19:20                                                                         ` David Miller
  2 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-21 19:20 UTC (permalink / raw)
  To: Finn Thain
  Cc: Greg KH, linux-kernel, Jeff Garzik, David S. Miller,
	Geert Uytterhoeven, Andrew Morton

Hi Finn,

On Wed, Jul 22, 2009 at 01:14:36AM +1000, Finn Thain wrote:
> On Sat, 11 Jul 2009, Uwe Kleine-K?nig wrote:
>
>> A pointer to mac_sonic_probe is passed to the core via  
>> platform_driver_register and so the function must not disappear when 
>> the .init sections are discarded.  Otherwise (if also having HOTPLUG=y) 
>> unbinding and binding a device to the driver via sysfs will result in 
>> an oops as does a device being registered late.
>
> This patch works for me (tested on a Quadra 630). I still get an oops on  
> rmmod, but that's a separate issue. I'll send a patch for that.
Thanks, I'll add a

	Tested-by: Finn Thain <fthain@telegraphics.com.au>

to the patch description.

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move macsonic's probe function to .devinit.text
  2009-07-21 15:14                                                                       ` [PATCH] move macsonic's probe function to .devinit.text Finn Thain
  2009-07-21 15:40                                                                         ` [PATCH] macsonic, jazzsonic - fix oops on module unload Finn Thain
  2009-07-21 19:20                                                                         ` [PATCH] move macsonic's probe function to .devinit.text Uwe Kleine-König
@ 2009-07-21 19:20                                                                         ` David Miller
  2009-07-21 19:40                                                                           ` Uwe Kleine-König
  2 siblings, 1 reply; 197+ messages in thread
From: David Miller @ 2009-07-21 19:20 UTC (permalink / raw)
  To: fthain; +Cc: u.kleine-koenig, gregkh, linux-kernel, jgarzik, geert, akpm

From: Finn Thain <fthain@telegraphics.com.au>
Date: Wed, 22 Jul 2009 01:14:36 +1000 (EST)

> 
> 
> On Sat, 11 Jul 2009, Uwe Kleine-K?nig wrote:
> 
>> A pointer to mac_sonic_probe is passed to the core via
>> platform_driver_register and so the function must not disappear when
>> the .init sections are discarded.  Otherwise (if also having
>> HOTPLUG=y) unbinding and binding a device to the driver via sysfs will
>> result in an oops as does a device being registered late.
> 
> This patch works for me (tested on a Quadra 630). I still get an oops
> on rmmod, but that's a separate issue. I'll send a patch for that.

Applied, but Uwe _please_ post networking patches to
netdev@vger.kernel.org so that they get properly logged
and tracked at:

http://patchwork.ozlabs.org/project/netdev/list/

Thank you.

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] macsonic, jazzsonic - fix oops on module unload
  2009-07-21 15:40                                                                         ` [PATCH] macsonic, jazzsonic - fix oops on module unload Finn Thain
@ 2009-07-21 19:22                                                                           ` David Miller
  0 siblings, 0 replies; 197+ messages in thread
From: David Miller @ 2009-07-21 19:22 UTC (permalink / raw)
  To: fthain; +Cc: netdev, gregkh, u.kleine-koenig

From: Finn Thain <fthain@telegraphics.com.au>
Date: Wed, 22 Jul 2009 01:40:02 +1000 (EST)

> 
> Set the driver data before using it. Fixes an oops when doing rmmod.
> 
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

Applied, thanks.

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move macsonic's probe function to .devinit.text
  2009-07-21 19:20                                                                         ` David Miller
@ 2009-07-21 19:40                                                                           ` Uwe Kleine-König
  2009-07-21 19:41                                                                             ` David Miller
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-21 19:40 UTC (permalink / raw)
  To: David Miller; +Cc: fthain, gregkh, linux-kernel, jgarzik, geert, akpm

Hi David,

On Tue, Jul 21, 2009 at 12:20:58PM -0700, David Miller wrote:
> From: Finn Thain <fthain@telegraphics.com.au>
> Date: Wed, 22 Jul 2009 01:14:36 +1000 (EST)
>
> > On Sat, 11 Jul 2009, Uwe Kleine-K?nig wrote:
> > 
> >> A pointer to mac_sonic_probe is passed to the core via
> >> platform_driver_register and so the function must not disappear when
> >> the .init sections are discarded.  Otherwise (if also having
> >> HOTPLUG=y) unbinding and binding a device to the driver via sysfs will
> >> result in an oops as does a device being registered late.
> > 
> > This patch works for me (tested on a Quadra 630). I still get an oops
> > on rmmod, but that's a separate issue. I'll send a patch for that.
> 
> Applied, but Uwe _please_ post networking patches to
> netdev@vger.kernel.org so that they get properly logged
> and tracked at:
There are 8 patches in this series that touch drivers/net, only one of
them had a Cc: to netdev.

The diffstat of my series for drivers/net is
 drivers/net/arm/am79c961a.c  |    2 +-
 drivers/net/arm/at91_ether.c |    2 +-
 drivers/net/jazzsonic.c      |    4 ++--
 drivers/net/macsonic.c       |   14 +++++++-------
 drivers/net/meth.c           |    2 +-
 drivers/net/sb1250-mac.c     |    2 +-
 drivers/net/sgiseeq.c        |    2 +-
 drivers/net/xtsonic.c        |    2 +-
 8 files changed, 15 insertions(+), 15 deletions(-)

drivers/net/arm/at91_ether.c got a NACK by David Brownell---he wants the
alternative to be implemented.
drivers/net/arm/am79c961a.c got the Cc to netdev@
You now took drivers/net/macsonic.c.

Should I repost the remaining 5 to netdev@?

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move macsonic's probe function to .devinit.text
  2009-07-21 19:40                                                                           ` Uwe Kleine-König
@ 2009-07-21 19:41                                                                             ` David Miller
  0 siblings, 0 replies; 197+ messages in thread
From: David Miller @ 2009-07-21 19:41 UTC (permalink / raw)
  To: u.kleine-koenig; +Cc: fthain, gregkh, linux-kernel, jgarzik, geert, akpm

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Tue, 21 Jul 2009 21:40:36 +0200

> Should I repost the remaining 5 to netdev@?

You should for at least the ones that don't require changes,
but once you fix those other one's up based upon feedback you
should make sure netdev at least gets CC:'d when you post
those too.

^ permalink raw reply	[flat|nested] 197+ messages in thread

* [PATCH] register at91_ether using platform_driver_probe
  2009-07-11 22:27                                       ` [PATCH] move at91_ether's " David Brownell
@ 2009-07-21 20:11                                         ` Uwe Kleine-König
  2009-07-22 17:37                                           ` David Brownell
  2009-07-22 17:46                                           ` Andrew Victor
  0 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-21 20:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: David Brownell, netdev, Paulius Zaleckas, Marc Pignat,
	Andrew Victor, Roel Kluin, Andrew Morton, Greg Kroah-Hartman

at91ether_probe lives in .init.text, so using platform_driver_register
to register it is wrong because binding a device after the init memory
is discarded (e.g. via sysfs) results in an oops.

As requested by David Brownell platform_driver_probe is used instead of
moving the probe function to .devinit.text as proposed initially.
This saves some memory, but devices registered after the driver is
probed are not bound (probably there are none) and binding via sysfs
isn't possible.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: netdev@vger.kernel.org
Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Cc: Marc Pignat <marc.pignat@hevs.ch>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/arm/at91_ether.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index 2e7419a..5041d10 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -1228,7 +1228,6 @@ static int at91ether_resume(struct platform_device *pdev)
 #endif
 
 static struct platform_driver at91ether_driver = {
-	.probe		= at91ether_probe,
 	.remove		= __devexit_p(at91ether_remove),
 	.suspend	= at91ether_suspend,
 	.resume		= at91ether_resume,
@@ -1240,7 +1239,7 @@ static struct platform_driver at91ether_driver = {
 
 static int __init at91ether_init(void)
 {
-	return platform_driver_register(&at91ether_driver);
+	return platform_driver_probe(&at91ether_driver, at91ether_probe);
 }
 
 static void __exit at91ether_exit(void)
-- 
tg: (4b0a840..) t/platsection/at91ether_driver (depends on: linus/master)

^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] register mmci-omap-hs using platform_driver_probe
  2009-07-11 22:29                                                                                 ` [PATCH] move mmci-omap-hs's probe function to .devinit.text David Brownell
@ 2009-07-21 20:36                                                                                   ` Uwe Kleine-König
  2009-07-22 17:38                                                                                     ` David Brownell
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-21 20:36 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jean Pihet, Tony Lindgren, Pierre Ossman, Andy Lowe,
	Adrian Hunter, Andrew Morton, David Brownell,
	Madhusudhan Chikkature, Greg Kroah-Hartman

omap_mmc_probe lives in .init.text, so using platform_driver_register
to register it is wrong because binding a device after the init memory
is discarded (e.g. via sysfs) results in an oops.

As requested by David Brownell platform_driver_probe is used instead of
moving the probe function to .devinit.text as proposed initially.
This saves some memory, but devices registered after the driver is
probed are not bound (probably there are none) and binding via sysfs
isn't possible.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Jean Pihet <jpihet@mvista.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Pierre Ossman <drzeus@drzeus.cx>
Cc: Andy Lowe <alowe@mvista.com>
Cc: Adrian Hunter <ext-adrian.hunter@nokia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Madhusudhan Chikkature<madhu.cr@ti.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/mmc/host/omap_hsmmc.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 1cf9cfb..40d9830 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1307,7 +1307,6 @@ clk_en_err:
 #endif
 
 static struct platform_driver omap_mmc_driver = {
-	.probe		= omap_mmc_probe,
 	.remove		= omap_mmc_remove,
 	.suspend	= omap_mmc_suspend,
 	.resume		= omap_mmc_resume,
@@ -1320,7 +1319,7 @@ static struct platform_driver omap_mmc_driver = {
 static int __init omap_mmc_init(void)
 {
 	/* Register the MMC driver */
-	return platform_driver_register(&omap_mmc_driver);
+	return platform_driver_probe(&omap_mmc_driver, omap_mmc_probe);
 }
 
 static void __exit omap_mmc_cleanup(void)
-- 
tg: (4b0a840..) t/platsection/omap_mmc_driver (depends on: linus/master)

^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] register orion_nand using platform_driver_probe
  2009-07-14 16:12                                                                                       ` Nicolas Pitre
@ 2009-07-21 20:46                                                                                           ` Uwe Kleine-König
  2009-07-21 20:46                                                                                           ` Uwe Kleine-König
  1 sibling, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-21 20:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Lennert Buytenhek, Saeed Bishara, Jörn Engel, Nicolas Pitre,
	Tzachi Perelstein, Andrew Morton, Greg Kroah-Hartman,
	David Woodhouse, linux-mtd

orion_nand_probe lives in .init.text, so using platform_driver_register
to register it is wrong because binding a device after the init memory
is discarded (e.g. via sysfs) results in an oops.

As requested by Nicolas Pitre platform_driver_probe is used instead of
moving the probe function to .devinit.text as proposed initially.
This saves some memory, but devices registered after the driver is
probed are not bound (probably there are none) and binding via sysfs
isn't possible.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Lennert Buytenhek <buytenh@marvell.com>
Cc: Saeed Bishara <saeed@marvell.com>
Cc: Jörn Engel <joern@logfs.org>
Cc: Nicolas Pitre <nico@marvell.com>
Cc: Tzachi Perelstein <tzachi@marvell.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org

---
 drivers/mtd/nand/orion_nand.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 7ad9722..cb9d13b 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -171,7 +171,6 @@ static int __devexit orion_nand_remove(struct platform_device *pdev)
 }
 
 static struct platform_driver orion_nand_driver = {
-	.probe		= orion_nand_probe,
 	.remove		= __devexit_p(orion_nand_remove),
 	.driver		= {
 		.name	= "orion_nand",
@@ -181,7 +180,7 @@ static struct platform_driver orion_nand_driver = {
 
 static int __init orion_nand_init(void)
 {
-	return platform_driver_register(&orion_nand_driver);
+	return platform_driver_probe(&orion_nand_driver, orion_nand_probe);
 }
 
 static void __exit orion_nand_exit(void)
-- 
tg: (4b0a840..) t/platsection/orion_nand_driver (depends on: linus/master)

^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] register orion_nand using platform_driver_probe
@ 2009-07-21 20:46                                                                                           ` Uwe Kleine-König
  0 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-21 20:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tzachi Perelstein, Jörn Engel, Nicolas Pitre, Saeed Bishara,
	linux-mtd, Andrew Morton, David Woodhouse, Greg Kroah-Hartman,
	Lennert Buytenhek

orion_nand_probe lives in .init.text, so using platform_driver_register
to register it is wrong because binding a device after the init memory
is discarded (e.g. via sysfs) results in an oops.

As requested by Nicolas Pitre platform_driver_probe is used instead of
moving the probe function to .devinit.text as proposed initially.
This saves some memory, but devices registered after the driver is
probed are not bound (probably there are none) and binding via sysfs
isn't possible.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Lennert Buytenhek <buytenh@marvell.com>
Cc: Saeed Bishara <saeed@marvell.com>
Cc: Jörn Engel <joern@logfs.org>
Cc: Nicolas Pitre <nico@marvell.com>
Cc: Tzachi Perelstein <tzachi@marvell.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org

---
 drivers/mtd/nand/orion_nand.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 7ad9722..cb9d13b 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -171,7 +171,6 @@ static int __devexit orion_nand_remove(struct platform_device *pdev)
 }
 
 static struct platform_driver orion_nand_driver = {
-	.probe		= orion_nand_probe,
 	.remove		= __devexit_p(orion_nand_remove),
 	.driver		= {
 		.name	= "orion_nand",
@@ -181,7 +180,7 @@ static struct platform_driver orion_nand_driver = {
 
 static int __init orion_nand_init(void)
 {
-	return platform_driver_register(&orion_nand_driver);
+	return platform_driver_probe(&orion_nand_driver, orion_nand_probe);
 }
 
 static void __exit orion_nand_exit(void)
-- 
tg: (4b0a840..) t/platsection/orion_nand_driver (depends on: linus/master)

^ permalink raw reply related	[flat|nested] 197+ messages in thread

* Re: [PATCH] register orion_nand using platform_driver_probe
  2009-07-21 20:46                                                                                           ` Uwe Kleine-König
@ 2009-07-21 22:26                                                                                             ` Nicolas Pitre
  -1 siblings, 0 replies; 197+ messages in thread
From: Nicolas Pitre @ 2009-07-21 22:26 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-kernel, Lennert Buijtenhek, Saeed Bishara, Jörn Engel,
	Andrew Morton, Greg Kroah-Hartman, David Woodhouse, linux-mtd

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2058 bytes --]

On Tue, 21 Jul 2009, Uwe Kleine-König wrote:

> orion_nand_probe lives in .init.text, so using platform_driver_register
> to register it is wrong because binding a device after the init memory
> is discarded (e.g. via sysfs) results in an oops.
> 
> As requested by Nicolas Pitre platform_driver_probe is used instead of
> moving the probe function to .devinit.text as proposed initially.
> This saves some memory, but devices registered after the driver is
> probed are not bound (probably there are none) and binding via sysfs
> isn't possible.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Lennert Buytenhek <buytenh@marvell.com>
> Cc: Saeed Bishara <saeed@marvell.com>
> Cc: Jörn Engel <joern@logfs.org>
> Cc: Nicolas Pitre <nico@marvell.com>
> Cc: Tzachi Perelstein <tzachi@marvell.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: linux-mtd@lists.infradead.org

Acked-by: Nicolas Pitre <nico@marvell.com>

Thanks.  BTW Tzachi's email address is no longer valid.

> ---
>  drivers/mtd/nand/orion_nand.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> index 7ad9722..cb9d13b 100644
> --- a/drivers/mtd/nand/orion_nand.c
> +++ b/drivers/mtd/nand/orion_nand.c
> @@ -171,7 +171,6 @@ static int __devexit orion_nand_remove(struct platform_device *pdev)
>  }
>  
>  static struct platform_driver orion_nand_driver = {
> -	.probe		= orion_nand_probe,
>  	.remove		= __devexit_p(orion_nand_remove),
>  	.driver		= {
>  		.name	= "orion_nand",
> @@ -181,7 +180,7 @@ static struct platform_driver orion_nand_driver = {
>  
>  static int __init orion_nand_init(void)
>  {
> -	return platform_driver_register(&orion_nand_driver);
> +	return platform_driver_probe(&orion_nand_driver, orion_nand_probe);
>  }
>  
>  static void __exit orion_nand_exit(void)
> -- 
> tg: (4b0a840..) t/platsection/orion_nand_driver (depends on: linus/master)
> 

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] register orion_nand using platform_driver_probe
@ 2009-07-21 22:26                                                                                             ` Nicolas Pitre
  0 siblings, 0 replies; 197+ messages in thread
From: Nicolas Pitre @ 2009-07-21 22:26 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Jörn Engel, Greg Kroah-Hartman, linux-kernel, Saeed Bishara,
	linux-mtd, Andrew Morton, David Woodhouse, Lennert Buijtenhek

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2058 bytes --]

On Tue, 21 Jul 2009, Uwe Kleine-König wrote:

> orion_nand_probe lives in .init.text, so using platform_driver_register
> to register it is wrong because binding a device after the init memory
> is discarded (e.g. via sysfs) results in an oops.
> 
> As requested by Nicolas Pitre platform_driver_probe is used instead of
> moving the probe function to .devinit.text as proposed initially.
> This saves some memory, but devices registered after the driver is
> probed are not bound (probably there are none) and binding via sysfs
> isn't possible.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Lennert Buytenhek <buytenh@marvell.com>
> Cc: Saeed Bishara <saeed@marvell.com>
> Cc: Jörn Engel <joern@logfs.org>
> Cc: Nicolas Pitre <nico@marvell.com>
> Cc: Tzachi Perelstein <tzachi@marvell.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: linux-mtd@lists.infradead.org

Acked-by: Nicolas Pitre <nico@marvell.com>

Thanks.  BTW Tzachi's email address is no longer valid.

> ---
>  drivers/mtd/nand/orion_nand.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> index 7ad9722..cb9d13b 100644
> --- a/drivers/mtd/nand/orion_nand.c
> +++ b/drivers/mtd/nand/orion_nand.c
> @@ -171,7 +171,6 @@ static int __devexit orion_nand_remove(struct platform_device *pdev)
>  }
>  
>  static struct platform_driver orion_nand_driver = {
> -	.probe		= orion_nand_probe,
>  	.remove		= __devexit_p(orion_nand_remove),
>  	.driver		= {
>  		.name	= "orion_nand",
> @@ -181,7 +180,7 @@ static struct platform_driver orion_nand_driver = {
>  
>  static int __init orion_nand_init(void)
>  {
> -	return platform_driver_register(&orion_nand_driver);
> +	return platform_driver_probe(&orion_nand_driver, orion_nand_probe);
>  }
>  
>  static void __exit orion_nand_exit(void)
> -- 
> tg: (4b0a840..) t/platsection/orion_nand_driver (depends on: linus/master)
> 

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] register orion_nand using platform_driver_probe
  2009-07-21 22:26                                                                                             ` Nicolas Pitre
@ 2009-07-22  5:17                                                                                               ` Uwe Kleine-König
  -1 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-22  5:17 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: linux-kernel, Lennert Buijtenhek, Saeed Bishara, Jörn Engel,
	Andrew Morton, Greg Kroah-Hartman, David Woodhouse, linux-mtd

Hi Nicolas,

On Tue, Jul 21, 2009 at 06:26:50PM -0400, Nicolas Pitre wrote:
> On Tue, 21 Jul 2009, Uwe Kleine-König wrote:
> 
> > orion_nand_probe lives in .init.text, so using platform_driver_register
> > to register it is wrong because binding a device after the init memory
> > is discarded (e.g. via sysfs) results in an oops.
> > 
> > As requested by Nicolas Pitre platform_driver_probe is used instead of
> > moving the probe function to .devinit.text as proposed initially.
> > This saves some memory, but devices registered after the driver is
> > probed are not bound (probably there are none) and binding via sysfs
> > isn't possible.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > Cc: Lennert Buytenhek <buytenh@marvell.com>
> > Cc: Saeed Bishara <saeed@marvell.com>
> > Cc: Jörn Engel <joern@logfs.org>
> > Cc: Nicolas Pitre <nico@marvell.com>
> > Cc: Tzachi Perelstein <tzachi@marvell.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Greg Kroah-Hartman <gregkh@suse.de>
> > Cc: David Woodhouse <dwmw2@infradead.org>
> > Cc: linux-mtd@lists.infradead.org
> 
> Acked-by: Nicolas Pitre <nico@marvell.com>
Did you test if all devices bind as expected?
 
> Thanks.  BTW Tzachi's email address is no longer valid.
Yes, I got a mail from Marvell's mailer daemon stating the same.  :-)

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] register orion_nand using platform_driver_probe
@ 2009-07-22  5:17                                                                                               ` Uwe Kleine-König
  0 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-07-22  5:17 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: Jörn Engel, Greg Kroah-Hartman, linux-kernel, Saeed Bishara,
	linux-mtd, Andrew Morton, David Woodhouse, Lennert Buijtenhek

Hi Nicolas,

On Tue, Jul 21, 2009 at 06:26:50PM -0400, Nicolas Pitre wrote:
> On Tue, 21 Jul 2009, Uwe Kleine-König wrote:
> 
> > orion_nand_probe lives in .init.text, so using platform_driver_register
> > to register it is wrong because binding a device after the init memory
> > is discarded (e.g. via sysfs) results in an oops.
> > 
> > As requested by Nicolas Pitre platform_driver_probe is used instead of
> > moving the probe function to .devinit.text as proposed initially.
> > This saves some memory, but devices registered after the driver is
> > probed are not bound (probably there are none) and binding via sysfs
> > isn't possible.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > Cc: Lennert Buytenhek <buytenh@marvell.com>
> > Cc: Saeed Bishara <saeed@marvell.com>
> > Cc: Jörn Engel <joern@logfs.org>
> > Cc: Nicolas Pitre <nico@marvell.com>
> > Cc: Tzachi Perelstein <tzachi@marvell.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Greg Kroah-Hartman <gregkh@suse.de>
> > Cc: David Woodhouse <dwmw2@infradead.org>
> > Cc: linux-mtd@lists.infradead.org
> 
> Acked-by: Nicolas Pitre <nico@marvell.com>
Did you test if all devices bind as expected?
 
> Thanks.  BTW Tzachi's email address is no longer valid.
Yes, I got a mail from Marvell's mailer daemon stating the same.  :-)

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] register at91_ether using platform_driver_probe
  2009-07-21 20:11                                         ` [PATCH] register at91_ether using platform_driver_probe Uwe Kleine-König
@ 2009-07-22 17:37                                           ` David Brownell
  2009-07-22 17:46                                           ` Andrew Victor
  1 sibling, 0 replies; 197+ messages in thread
From: David Brownell @ 2009-07-22 17:37 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-kernel, David Brownell, netdev, Paulius Zaleckas,
	Marc Pignat, Andrew Victor, Roel Kluin, Andrew Morton,
	Greg Kroah-Hartman

On Tuesday 21 July 2009, Uwe Kleine-König wrote:
> at91ether_probe lives in .init.text, so using platform_driver_register
> to register it is wrong because binding a device after the init memory
> is discarded (e.g. via sysfs) results in an oops.
> 
> As requested by David Brownell platform_driver_probe is used instead of
> moving the probe function to .devinit.text as proposed initially.
> This saves some memory, but devices registered after the driver is
> probed are not bound (probably there are none) and binding via sysfs
> isn't possible.

Right, these devices do not hotplug.

> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: David Brownell <dbrownell@users.sourceforge.net>

Acked-by: David Brownell <dbrownell@users.sourceforge.net>

.... and thanks for doing it this way.  :)

> Cc: netdev@vger.kernel.org
> Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
> Cc: Marc Pignat <marc.pignat@hevs.ch>
> Cc: Andrew Victor <linux@maxim.org.za>
> Cc: Roel Kluin <12o3l@tiscali.nl>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> 
> ---
>  drivers/net/arm/at91_ether.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
> index 2e7419a..5041d10 100644
> --- a/drivers/net/arm/at91_ether.c
> +++ b/drivers/net/arm/at91_ether.c
> @@ -1228,7 +1228,6 @@ static int at91ether_resume(struct platform_device *pdev)
>  #endif
>  
>  static struct platform_driver at91ether_driver = {
> -	.probe		= at91ether_probe,
>  	.remove		= __devexit_p(at91ether_remove),
>  	.suspend	= at91ether_suspend,
>  	.resume		= at91ether_resume,
> @@ -1240,7 +1239,7 @@ static struct platform_driver at91ether_driver = {
>  
>  static int __init at91ether_init(void)
>  {
> -	return platform_driver_register(&at91ether_driver);
> +	return platform_driver_probe(&at91ether_driver, at91ether_probe);
>  }
>  
>  static void __exit at91ether_exit(void)
> -- 
> tg: (4b0a840..) t/platsection/at91ether_driver (depends on: linus/master)
> 
> 




^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] register mmci-omap-hs using platform_driver_probe
  2009-07-21 20:36                                                                                   ` [PATCH] register mmci-omap-hs using platform_driver_probe Uwe Kleine-König
@ 2009-07-22 17:38                                                                                     ` David Brownell
  0 siblings, 0 replies; 197+ messages in thread
From: David Brownell @ 2009-07-22 17:38 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-kernel, Jean Pihet, Tony Lindgren, Pierre Ossman,
	Andy Lowe, Adrian Hunter, Andrew Morton, Madhusudhan Chikkature,
	Greg Kroah-Hartman

On Tuesday 21 July 2009, Uwe Kleine-König wrote:
> omap_mmc_probe lives in .init.text, so using platform_driver_register
> to register it is wrong because binding a device after the init memory
> is discarded (e.g. via sysfs) results in an oops.
> 
> As requested by David Brownell platform_driver_probe is used instead of
> moving the probe function to .devinit.text as proposed initially.
> This saves some memory, but devices registered after the driver is
> probed are not bound (probably there are none) and binding via sysfs
> isn't possible.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Jean Pihet <jpihet@mvista.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Pierre Ossman <drzeus@drzeus.cx>
> Cc: Andy Lowe <alowe@mvista.com>
> Cc: Adrian Hunter <ext-adrian.hunter@nokia.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Brownell <dbrownell@users.sourceforge.net>

Acked-by: David Brownell <dbrownell@users.sourceforge.net>

> Cc: Madhusudhan Chikkature<madhu.cr@ti.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> 
> ---
>  drivers/mmc/host/omap_hsmmc.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 1cf9cfb..40d9830 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -1307,7 +1307,6 @@ clk_en_err:
>  #endif
>  
>  static struct platform_driver omap_mmc_driver = {
> -	.probe		= omap_mmc_probe,
>  	.remove		= omap_mmc_remove,
>  	.suspend	= omap_mmc_suspend,
>  	.resume		= omap_mmc_resume,
> @@ -1320,7 +1319,7 @@ static struct platform_driver omap_mmc_driver = {
>  static int __init omap_mmc_init(void)
>  {
>  	/* Register the MMC driver */
> -	return platform_driver_register(&omap_mmc_driver);
> +	return platform_driver_probe(&omap_mmc_driver, omap_mmc_probe);
>  }
>  
>  static void __exit omap_mmc_cleanup(void)
> -- 
> tg: (4b0a840..) t/platsection/omap_mmc_driver (depends on: linus/master)
> 
> 




^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] register at91_ether using platform_driver_probe
  2009-07-21 20:11                                         ` [PATCH] register at91_ether using platform_driver_probe Uwe Kleine-König
  2009-07-22 17:37                                           ` David Brownell
@ 2009-07-22 17:46                                           ` Andrew Victor
  2009-07-22 18:24                                             ` David Miller
  1 sibling, 1 reply; 197+ messages in thread
From: Andrew Victor @ 2009-07-22 17:46 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-kernel, David Brownell, netdev, Paulius Zaleckas,
	Marc Pignat, Andrew Victor, Roel Kluin, Andrew Morton,
	Greg Kroah-Hartman

hi,

> at91ether_probe lives in .init.text, so using platform_driver_register
> to register it is wrong because binding a device after the init memory
> is discarded (e.g. via sysfs) results in an oops.
>
> As requested by David Brownell platform_driver_probe is used instead of
> moving the probe function to .devinit.text as proposed initially.
> This saves some memory, but devices registered after the driver is
> probed are not bound (probably there are none) and binding via sysfs
> isn't possible.


Acked-by: Andrew Victor <linux@maxim.org.za>

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] register at91_ether using platform_driver_probe
  2009-07-22 17:46                                           ` Andrew Victor
@ 2009-07-22 18:24                                             ` David Miller
  0 siblings, 0 replies; 197+ messages in thread
From: David Miller @ 2009-07-22 18:24 UTC (permalink / raw)
  To: avictor.za
  Cc: u.kleine-koenig, linux-kernel, dbrownell, netdev,
	paulius.zaleckas, marc.pignat, linux, 12o3l, akpm, gregkh

From: Andrew Victor <avictor.za@gmail.com>
Date: Wed, 22 Jul 2009 19:46:24 +0200

> hi,
> 
>> at91ether_probe lives in .init.text, so using platform_driver_register
>> to register it is wrong because binding a device after the init memory
>> is discarded (e.g. via sysfs) results in an oops.
>>
>> As requested by David Brownell platform_driver_probe is used instead of
>> moving the probe function to .devinit.text as proposed initially.
>> This saves some memory, but devices registered after the driver is
>> probed are not bound (probably there are none) and binding via sysfs
>> isn't possible.
> 
> 
> Acked-by: Andrew Victor <linux@maxim.org.za>

Applied, thanks everyone.

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move stk17ta8's probe function to .devinit.text
  2009-07-11 20:53                                                                                                       ` [PATCH] move stk17ta8's " Uwe Kleine-König
  2009-07-11 20:53                                                                                                         ` [PATCH] move omap_udc's " Uwe Kleine-König
@ 2009-08-13  9:59                                                                                                         ` Jiri Kosina
  2009-10-09 15:24                                                                                                         ` Jiri Kosina
  2 siblings, 0 replies; 197+ messages in thread
From: Jiri Kosina @ 2009-08-13  9:59 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Anton Vorontsov, Alessandro Zummo,
	David Brownell, Paul Mundt, Andrew Morton, Hannes Eder

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1709 bytes --]

On Sat, 11 Jul 2009, Uwe Kleine-König wrote:

> A pointer to stk17ta8_rtc_probe is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Hannes Eder <hannes@hanneseder.net>
> Cc: Jiri Kosina <jkosina@suse.cz>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> ---
>  drivers/rtc/rtc-stk17ta8.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-stk17ta8.c b/drivers/rtc/rtc-stk17ta8.c
> index 7d1547b..d491eb2 100644
> --- a/drivers/rtc/rtc-stk17ta8.c
> +++ b/drivers/rtc/rtc-stk17ta8.c
> @@ -286,7 +286,7 @@ static struct bin_attribute stk17ta8_nvram_attr = {
>  	.write = stk17ta8_nvram_write,
>  };
>  
> -static int __init stk17ta8_rtc_probe(struct platform_device *pdev)
> +static int __devinit stk17ta8_rtc_probe(struct platform_device *pdev)
>  {
>  	struct rtc_device *rtc;
>  	struct resource *res;

Has this been picked up by anyone? I don't seem to see it in linux-next as 
of today.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-07-11 17:05                             ` Greg KH
  2009-07-11 20:52                                 ` Uwe Kleine-König
@ 2009-09-07 14:19                               ` Uwe Kleine-König
  2010-01-22 17:06                                 ` Uwe Kleine-König
  2009-09-21  7:54                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
  2 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2009-09-07 14:19 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Hi Greg,

On Sat, Jul 11, 2009 at 10:05:48AM -0700, Greg KH wrote:
> On Sat, Jul 11, 2009 at 12:00:14PM +0200, Uwe Kleine-König wrote:
> > Hi Greg,
> > 
> > > > Are you conviced and took the patch or did you give up to convince me?
> > > 
> > > Heh, no, sorry, it got burried in my queue.
> > > 
> > > > I still think the patch is correct and I'd like to have it applied.
> > > 
> > > Ok, let's test it out in the linux-next tree for a while to make sure it
> > > works properly.  Care to send me an updated version?
> > I updated to latest Linus' master.  It applies to linux-next from
> > Fri Jul 10 14:44:30 2009 +1000 as is.
> 
> Thanks, I'll apply it later today to my trees.
ping?!

> > Back some time I sent a series that fixes many of these bugs.  I will
> > update it later today and resend.
> 
> Thanks, that would be good to have, to keep the noise down for devices
> we already know about.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move sh_flctl's probe function to .devinit.text
  2009-07-11 20:52                                                   ` [PATCH] move sh_flctl's " Uwe Kleine-König
  2009-07-11 20:52                                                     ` [PATCH] move gbefb's " Uwe Kleine-König
@ 2009-09-19 23:09                                                     ` David Woodhouse
  2009-09-21  7:43                                                       ` Uwe Kleine-König
  1 sibling, 1 reply; 197+ messages in thread
From: David Woodhouse @ 2009-09-19 23:09 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Greg KH, linux-kernel, Paul Mundt, Andrew Morton

On Sat, 2009-07-11 at 13:52 -0700, Uwe Kleine-König wrote:
> A pointer to flctl_probe is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.

... which is what you did for orion_nand, so let's do that for sh_flctl
too.

http://git.infradead.org/mtd-2.6.git/commitdiff/894572a3635

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move sh_flctl's probe function to .devinit.text
  2009-09-19 23:09                                                     ` [PATCH] move sh_flctl's " David Woodhouse
@ 2009-09-21  7:43                                                       ` Uwe Kleine-König
  0 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-09-21  7:43 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Greg KH, linux-kernel, Paul Mundt, Andrew Morton

Hello,

On Sat, Sep 19, 2009 at 04:09:54PM -0700, David Woodhouse wrote:
> On Sat, 2009-07-11 at 13:52 -0700, Uwe Kleine-König wrote:
> > A pointer to flctl_probe is passed to the core via
> > platform_driver_register and so the function must not disappear when the
> > .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> > unbinding and binding a device to the driver via sysfs will result in an
> > oops as does a device being registered late.
> > 
> > An alternative to this patch is using platform_driver_probe instead of
> > platform_driver_register plus removing the pointer to the probe function
> > from the struct platform_driver.
> 
> ... which is what you did for orion_nand, so let's do that for sh_flctl
> too.
> 
> http://git.infradead.org/mtd-2.6.git/commitdiff/894572a3635
Ah, you already did it, fine.  If you want (and still can) you can add
my Acked-by:

Best regards, thanks
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-07-11 17:05                             ` Greg KH
  2009-07-11 20:52                                 ` Uwe Kleine-König
  2009-09-07 14:19                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
@ 2009-09-21  7:54                               ` Uwe Kleine-König
  2 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2009-09-21  7:54 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Hello Greg,

On Sat, Jul 11, 2009 at 10:05:48AM -0700, Greg KH wrote:
> On Sat, Jul 11, 2009 at 12:00:14PM +0200, Uwe Kleine-König wrote:
> > Hi Greg,
> > 
> > > > Are you conviced and took the patch or did you give up to convince me?
> > > 
> > > Heh, no, sorry, it got burried in my queue.
I assume this is normal for you? :-)

> > > > I still think the patch is correct and I'd like to have it applied.
> > > 
> > > Ok, let's test it out in the linux-next tree for a while to make sure it
> > > works properly.  Care to send me an updated version?
> > I updated to latest Linus' master.  It applies to linux-next from
> > Fri Jul 10 14:44:30 2009 +1000 as is.
> 
> Thanks, I'll apply it later today to my trees.
>
> > Back some time I sent a series that fixes many of these bugs.  I will
> > update it later today and resend.
> 
> Thanks, that would be good to have, to keep the noise down for devices
> we already know about.
As of today I don't see my patches in linux-next.  Are you still
interested?  Can I ease taking the patches for you somehow?  E.g. by
sending a tar containing a quilt series?

Do you think it would be more sensible to convert the drivers to use
platform_driver_probe as this is what some commentors request.
The downside is that these can result in regressions (i.e. no driver
binding if the device is created after the driver is registered).
So this would be merge-window material.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move stk17ta8's probe function to .devinit.text
  2009-07-11 20:53                                                                                                       ` [PATCH] move stk17ta8's " Uwe Kleine-König
  2009-07-11 20:53                                                                                                         ` [PATCH] move omap_udc's " Uwe Kleine-König
  2009-08-13  9:59                                                                                                         ` [PATCH] move stk17ta8's probe function to .devinit.text Jiri Kosina
@ 2009-10-09 15:24                                                                                                         ` Jiri Kosina
  2009-10-09 18:33                                                                                                           ` Alessandro Zummo
  2 siblings, 1 reply; 197+ messages in thread
From: Jiri Kosina @ 2009-10-09 15:24 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Anton Vorontsov, Alessandro Zummo,
	David Brownell, Paul Mundt, Andrew Morton, Hannes Eder

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1750 bytes --]

On Sat, 11 Jul 2009, Uwe Kleine-König wrote:

> A pointer to stk17ta8_rtc_probe is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Hannes Eder <hannes@hanneseder.net>
> Cc: Jiri Kosina <jkosina@suse.cz>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> ---
>  drivers/rtc/rtc-stk17ta8.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-stk17ta8.c b/drivers/rtc/rtc-stk17ta8.c
> index 7d1547b..d491eb2 100644
> --- a/drivers/rtc/rtc-stk17ta8.c
> +++ b/drivers/rtc/rtc-stk17ta8.c
> @@ -286,7 +286,7 @@ static struct bin_attribute stk17ta8_nvram_attr = {
>  	.write = stk17ta8_nvram_write,
>  };
>  
> -static int __init stk17ta8_rtc_probe(struct platform_device *pdev)
> +static int __devinit stk17ta8_rtc_probe(struct platform_device *pdev)
>  {
>  	struct rtc_device *rtc;
>  	struct resource *res;

This seems to get lost ... should I take it through my tree, or is anyone 
going to merge it? Andrew? Alessandro?

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move stk17ta8's probe function to .devinit.text
  2009-10-09 15:24                                                                                                         ` Jiri Kosina
@ 2009-10-09 18:33                                                                                                           ` Alessandro Zummo
  2009-10-09 21:22                                                                                                             ` Jiri Kosina
  0 siblings, 1 reply; 197+ messages in thread
From: Alessandro Zummo @ 2009-10-09 18:33 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Uwe Kleine-König, Greg KH, linux-kernel, Anton Vorontsov,
	Alessandro Zummo, David Brownell, Paul Mundt, Andrew Morton,
	Hannes Eder

On Fri, 9 Oct 2009 17:24:51 +0200 (CEST)
Jiri Kosina <jkosina@suse.cz> wrote:

> > -static int __init stk17ta8_rtc_probe(struct platform_device *pdev)
> > +static int __devinit stk17ta8_rtc_probe(struct platform_device *pdev)
> >  {
> >  	struct rtc_device *rtc;
> >  	struct resource *res;  
> 
> This seems to get lost ... should I take it through my tree, or is anyone 
> going to merge it? Andrew? Alessandro?

 Did you sent it to the rtc mailing list? I can't find it in patchwork.
 You can carry it in your tree.
 
 Acked-by: Alessandro Zummo <a.zummo@towertech.it>

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it


^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move stk17ta8's probe function to .devinit.text
  2009-10-09 18:33                                                                                                           ` Alessandro Zummo
@ 2009-10-09 21:22                                                                                                             ` Jiri Kosina
  2009-10-09 21:55                                                                                                               ` Alessandro Zummo
  0 siblings, 1 reply; 197+ messages in thread
From: Jiri Kosina @ 2009-10-09 21:22 UTC (permalink / raw)
  To: Alessandro Zummo
  Cc: Uwe Kleine-König, Greg KH, linux-kernel, Anton Vorontsov,
	Alessandro Zummo, David Brownell, Paul Mundt, Andrew Morton,
	Hannes Eder

On Fri, 9 Oct 2009, Alessandro Zummo wrote:

> > > -static int __init stk17ta8_rtc_probe(struct platform_device *pdev)
> > > +static int __devinit stk17ta8_rtc_probe(struct platform_device *pdev)
> > >  {
> > >  	struct rtc_device *rtc;
> > >  	struct resource *res;  
> > 
> > This seems to get lost ... should I take it through my tree, or is anyone 
> > going to merge it? Andrew? Alessandro?
>  Did you sent it to the rtc mailing list? I can't find it in patchwork.

It was probably sent only to you personally ...

>  You can carry it in your tree.
>  Acked-by: Alessandro Zummo <a.zummo@towertech.it>

Queued, thanks.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] move stk17ta8's probe function to .devinit.text
  2009-10-09 21:22                                                                                                             ` Jiri Kosina
@ 2009-10-09 21:55                                                                                                               ` Alessandro Zummo
  0 siblings, 0 replies; 197+ messages in thread
From: Alessandro Zummo @ 2009-10-09 21:55 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-kernel, Hannes Eder

On Fri, 9 Oct 2009 23:22:52 +0200 (CEST)
Jiri Kosina <jkosina@suse.cz> wrote:

> It was probably sent only to you personally ...

 Always Cc the mailing list, that way it will enter patchwork.
 I'm bad enough at patch tracking and patchwork gives a nice help ;)


-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it


^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2009-09-07 14:19                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
@ 2010-01-22 17:06                                 ` Uwe Kleine-König
  2010-01-22 17:38                                   ` Greg KH
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-22 17:06 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Hello,

On Mon, Sep 07, 2009 at 04:19:41PM +0200, Uwe Kleine-König wrote:
> Hi Greg,
> 
> On Sat, Jul 11, 2009 at 10:05:48AM -0700, Greg KH wrote:
> > On Sat, Jul 11, 2009 at 12:00:14PM +0200, Uwe Kleine-König wrote:
> > > Hi Greg,
> > > 
> > > > > Are you conviced and took the patch or did you give up to convince me?
> > > > 
> > > > Heh, no, sorry, it got burried in my queue.
> > > > 
> > > > > I still think the patch is correct and I'd like to have it applied.
> > > > 
> > > > Ok, let's test it out in the linux-next tree for a while to make sure it
> > > > works properly.  Care to send me an updated version?
> > > I updated to latest Linus' master.  It applies to linux-next from
> > > Fri Jul 10 14:44:30 2009 +1000 as is.
> > 
> > Thanks, I'll apply it later today to my trees.
> ping?!
> 
> > > Back some time I sent a series that fixes many of these bugs.  I will
> > > update it later today and resend.
> > 
> > Thanks, that would be good to have, to keep the noise down for devices
> > we already know about.
ping?  I assume you don't have the original mails anymore, so should I
resend?

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2010-01-22 17:06                                 ` Uwe Kleine-König
@ 2010-01-22 17:38                                   ` Greg KH
  2010-01-22 19:49                                     ` Uwe Kleine-König
  2010-01-26  8:59                                     ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
  0 siblings, 2 replies; 197+ messages in thread
From: Greg KH @ 2010-01-22 17:38 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-kernel

On Fri, Jan 22, 2010 at 06:06:41PM +0100, Uwe Kleine-König wrote:
> Hello,
> 
> On Mon, Sep 07, 2009 at 04:19:41PM +0200, Uwe Kleine-König wrote:
> > Hi Greg,
> > 
> > On Sat, Jul 11, 2009 at 10:05:48AM -0700, Greg KH wrote:
> > > On Sat, Jul 11, 2009 at 12:00:14PM +0200, Uwe Kleine-König wrote:
> > > > Hi Greg,
> > > > 
> > > > > > Are you conviced and took the patch or did you give up to convince me?
> > > > > 
> > > > > Heh, no, sorry, it got burried in my queue.
> > > > > 
> > > > > > I still think the patch is correct and I'd like to have it applied.
> > > > > 
> > > > > Ok, let's test it out in the linux-next tree for a while to make sure it
> > > > > works properly.  Care to send me an updated version?
> > > > I updated to latest Linus' master.  It applies to linux-next from
> > > > Fri Jul 10 14:44:30 2009 +1000 as is.
> > > 
> > > Thanks, I'll apply it later today to my trees.
> > ping?!
> > 
> > > > Back some time I sent a series that fixes many of these bugs.  I will
> > > > update it later today and resend.
> > > 
> > > Thanks, that would be good to have, to keep the noise down for devices
> > > we already know about.
> ping?  I assume you don't have the original mails anymore, so should I
> resend?

Yes, sorry.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-22 17:38                                   ` Greg KH
@ 2010-01-22 19:49                                     ` Uwe Kleine-König
  2010-01-22 23:49                                       ` Dmitry Torokhov
                                                         ` (30 more replies)
  2010-01-26  8:59                                     ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
  1 sibling, 31 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-22 19:49 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/base/platform.c |   42 ++++++++++++++++++++++++++++++++++++------
 include/linux/kernel.h  |    2 ++
 include/linux/module.h  |   12 ++++++++++++
 kernel/extable.c        |   12 ++++++++++++
 kernel/module.c         |   36 ++++++++++++++++++++++++++++++++++++
 5 files changed, 98 insertions(+), 6 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 58efaf2..92d2a75 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -472,11 +472,7 @@ static void platform_drv_shutdown(struct device *_dev)
 	drv->shutdown(dev);
 }
 
-/**
- * platform_driver_register
- * @drv: platform driver structure
- */
-int platform_driver_register(struct platform_driver *drv)
+static int __platform_driver_register(struct platform_driver *drv)
 {
 	drv->driver.bus = &platform_bus_type;
 	if (drv->probe)
@@ -488,6 +484,40 @@ int platform_driver_register(struct platform_driver *drv)
 
 	return driver_register(&drv->driver);
 }
+
+/**
+ * platform_driver_register
+ * @drv: platform driver structure
+ */
+int platform_driver_register(struct platform_driver *drv)
+{
+	int ret = __platform_driver_register(drv);
+
+#if defined(CONFIG_HOTPLUG)
+	/*
+	 * drivers that are registered by platform_driver_register
+	 * should not have their probe function in .init.text.  The
+	 * reason is that a probe can happen after .init.text is
+	 * discarded which then results in an oops.  The alternatives
+	 * are using .devinit.text for the probe function or "register"
+	 * with platform_driver_probe.
+	 */
+	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
+		pr_warning("oops-warning: probe function of platform driver %s"
+			       " lives in .init.text\n", drv->driver.name);
+#else
+	/*
+	 * without HOTPLUG probe functions can be discarded after the driver is
+	 * loaded.
+	 * There is a little chance for false positives, namely if the driver is
+	 * registered after the .init sections are discarded.
+	 */
+	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
+		pr_info("probably the probe function of platform driver %s can"
+				" be moved to .init.text\n", drv->driver.name);
+#endif
+	return ret;
+}
 EXPORT_SYMBOL_GPL(platform_driver_register);
 
 /**
@@ -527,7 +557,7 @@ int __init_or_module platform_driver_probe(struct platform_driver *drv,
 
 	/* temporary section violation during probe() */
 	drv->probe = probe;
-	retval = code = platform_driver_register(drv);
+	retval = code = __platform_driver_register(drv);
 
 	/*
 	 * Fixup that section violation, being paranoid about code scanning
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 328bca6..dc8b191 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -203,8 +203,10 @@ extern char *get_options(const char *str, int nints, int *ints);
 extern unsigned long long memparse(const char *ptr, char **retptr);
 
 extern int core_kernel_text(unsigned long addr);
+extern int core_kernel_init_text(unsigned long addr)
 extern int __kernel_text_address(unsigned long addr);
 extern int kernel_text_address(unsigned long addr);
+extern int kernel_init_text_address(unsigned long addr);
 extern int func_ptr_is_kernel_text(void *ptr);
 
 struct pid;
diff --git a/include/linux/module.h b/include/linux/module.h
index 6cb1a3c..00a8bc3 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -391,9 +391,11 @@ static inline int module_is_live(struct module *mod)
 }
 
 struct module *__module_text_address(unsigned long addr);
+struct module *__module_init_text_address(unsigned long addr);
 struct module *__module_address(unsigned long addr);
 bool is_module_address(unsigned long addr);
 bool is_module_text_address(unsigned long addr);
+bool is_module_init_text_address(unsigned long addr);
 
 static inline int within_module_core(unsigned long addr, struct module *mod)
 {
@@ -566,6 +568,11 @@ static inline struct module *__module_text_address(unsigned long addr)
 	return NULL;
 }
 
+static inline struct module *__module_init_text_address(unsigned long addr)
+{
+	return NULL;
+}
+
 static inline bool is_module_address(unsigned long addr)
 {
 	return false;
@@ -576,6 +583,11 @@ static inline bool is_module_text_address(unsigned long addr)
 	return false;
 }
 
+static inline bool is_module_init_text_address(unsigned long addr)
+{
+	return false;
+}
+
 /* Get/put a kernel symbol (calls should be symmetric) */
 #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
 #define symbol_put(x) do { } while(0)
diff --git a/kernel/extable.c b/kernel/extable.c
index 7f8f263..bfd7bda 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -66,6 +66,11 @@ int core_kernel_text(unsigned long addr)
 	    addr <= (unsigned long)_etext)
 		return 1;
 
+	return core_kernel_init_text;
+}
+
+int core_kernel_init_text(unsigned long addr)
+{
 	if (system_state == SYSTEM_BOOTING &&
 	    init_kernel_text(addr))
 		return 1;
@@ -98,6 +103,13 @@ int kernel_text_address(unsigned long addr)
 	return is_module_text_address(addr);
 }
 
+int kernel_init_text_address(unsigned long addr)
+{
+	if (core_kernel_init_text(addr))
+		return 1;
+	return is_module_init_text_address(addr);
+}
+
 /*
  * On some architectures (PPC64, IA64) function pointers
  * are actually only tokens to some data that then holds the
diff --git a/kernel/module.c b/kernel/module.c
index f82386b..219827d 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2922,6 +2922,22 @@ bool is_module_text_address(unsigned long addr)
 }
 
 /*
+ * is_module_init_text_address - is this address inside a module's .init.text
+ * section?
+ * @addr: the address to check.
+ */
+bool is_module_init_text_address(unsigned long addr)
+{
+	bool ret;
+
+	preempt_disable();
+	ret = __module_init_text_address(addr) != NULL;
+	preempt_enable();
+
+	return ret;
+}
+
+/*
  * __module_text_address - get the module whose code contains an address.
  * @addr: the address.
  *
@@ -2941,6 +2957,26 @@ struct module *__module_text_address(unsigned long addr)
 }
 EXPORT_SYMBOL_GPL(__module_text_address);
 
+/*
+ * __module_init_text_address - get the module whose .init.text contains an
+ * address.
+ * @addr: the address.
+ *
+ * Must be called with preempt disabled or module mutex held so that
+ * module doesn't get freed during this.
+ */
+struct module *__module_init_text_address(unsigned long addr)
+{
+	struct module *mod = __module_address(addr);
+	if (mod) {
+		/* Make sure it's within the .init.text section. */
+		if (!within(addr, mod->module_init, mod->init_text_size))
+			mod = NULL;
+	}
+	return mod;
+}
+EXPORT_SYMBOL_GPL(__module_init_text_address);
+
 /* Don't grab lock, we're oopsing. */
 void print_modules(void)
 {
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
@ 2010-01-22 23:49                                       ` Dmitry Torokhov
  2010-01-23  9:49                                         ` Uwe Kleine-König
  2010-01-23 20:35                                         ` Uwe Kleine-König
                                                         ` (29 subsequent siblings)
  30 siblings, 1 reply; 197+ messages in thread
From: Dmitry Torokhov @ 2010-01-22 23:49 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Greg KH, linux-kernel

Hi Uwe,

On Fri, Jan 22, 2010 at 08:49:18PM +0100, Uwe Kleine-König wrote:
> +int platform_driver_register(struct platform_driver *drv)
> +{
> +	int ret = __platform_driver_register(drv);
> +
> +#if defined(CONFIG_HOTPLUG)
> +	/*
> +	 * drivers that are registered by platform_driver_register
> +	 * should not have their probe function in .init.text.  The
> +	 * reason is that a probe can happen after .init.text is
> +	 * discarded which then results in an oops.  The alternatives
> +	 * are using .devinit.text for the probe function or "register"
> +	 * with platform_driver_probe.
> +	 */


What about CONFIG_MODULE case (without hotplug)? The driver may be
compiled in (and thus probe will be discarded) but device might be
created by a loadable module which is loaded later.

> +	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
> +		pr_warning("oops-warning: probe function of platform driver %s"
> +			       " lives in .init.text\n", drv->driver.name);
> +#else
> +	/*
> +	 * without HOTPLUG probe functions can be discarded after the driver is
> +	 * loaded.
> +	 * There is a little chance for false positives, namely if the driver is
> +	 * registered after the .init sections are discarded.
> +	 */
> +	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
> +		pr_info("probably the probe function of platform driver %s can"
> +				" be moved to .init.text\n", drv->driver.name);

It really depends on the user's (or rather builder's) local
configuration so how can we make this suggestion?

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-22 23:49                                       ` Dmitry Torokhov
@ 2010-01-23  9:49                                         ` Uwe Kleine-König
  2010-01-25 17:14                                           ` Dmitry Torokhov
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23  9:49 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Greg KH, linux-kernel

Helle Dmitry,

On Fri, Jan 22, 2010 at 03:49:37PM -0800, Dmitry Torokhov wrote:
> On Fri, Jan 22, 2010 at 08:49:18PM +0100, Uwe Kleine-König wrote:
> > +int platform_driver_register(struct platform_driver *drv)
> > +{
> > +	int ret = __platform_driver_register(drv);
> > +
> > +#if defined(CONFIG_HOTPLUG)
> > +	/*
> > +	 * drivers that are registered by platform_driver_register
> > +	 * should not have their probe function in .init.text.  The
> > +	 * reason is that a probe can happen after .init.text is
> > +	 * discarded which then results in an oops.  The alternatives
> > +	 * are using .devinit.text for the probe function or "register"
> > +	 * with platform_driver_probe.
> > +	 */
> 
> 
> What about CONFIG_MODULE case (without hotplug)? The driver may be
> compiled in (and thus probe will be discarded) but device might be
> created by a loadable module which is loaded later.
I don't see the problem here.  If the driver is registered using
platform_driver_register and the probe function lives in .init.text it
doesn't matter where the device comes from.  If there is one you can
unbind and bind at a later time when .init is already discarded.  No?

More general, using platform_driver_register the pointer to the probe
function have to stay valid as it is saved for later use, so it must not
be an .init pointer.

> > +	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
> > +		pr_warning("oops-warning: probe function of platform driver %s"
> > +			       " lives in .init.text\n", drv->driver.name);
> > +#else
> > +	/*
> > +	 * without HOTPLUG probe functions can be discarded after the driver is
> > +	 * loaded.
> > +	 * There is a little chance for false positives, namely if the driver is
> > +	 * registered after the .init sections are discarded.
> > +	 */
> > +	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
> > +		pr_info("probably the probe function of platform driver %s can"
> > +				" be moved to .init.text\n", drv->driver.name);
> 
> It really depends on the user's (or rather builder's) local
> configuration so how can we make this suggestion?
Can you point out a situation that makes the suggestion wrong?  AFAIK
there only the possibility that the driver is loaded after .init is
discarded (as written in the comment).

Thanks
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* [PATCH 01/29] move acornfb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
@ 2010-01-23 20:35                                         ` Uwe Kleine-König
  2010-01-23 20:35                                         ` Uwe Kleine-König
                                                           ` (29 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Christoph Hellwig, Antonino Daplas,
	linux-fbdev-devel, Andrew Morton

A pointer to acornfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Antonino Daplas <adaplas@pol.net>
Cc: linux-fbdev-devel@lists.sourceforge.net
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/acornfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index 0bcc59e..43d7d50 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -1221,7 +1221,7 @@ free_unused_pages(unsigned int virtual_start, unsigned int virtual_end)
 	printk("acornfb: freed %dK memory\n", mb_freed);
 }
 
-static int __init acornfb_probe(struct platform_device *dev)
+static int __devinit acornfb_probe(struct platform_device *dev)
 {
 	unsigned long size;
 	u_int h_sync, v_sync;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 01/29] move acornfb's probe function to .devinit.text
@ 2010-01-23 20:35                                         ` Uwe Kleine-König
  0 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Christoph Hellwig, Antonino Daplas,
	linux-fbdev-devel, Andrew Morton

A pointer to acornfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Antonino Daplas <adaplas@pol.net>
Cc: linux-fbdev-devel@lists.sourceforge.net
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/acornfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index 0bcc59e..43d7d50 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -1221,7 +1221,7 @@ free_unused_pages(unsigned int virtual_start, unsigned int virtual_end)
 	printk("acornfb: freed %dK memory\n", mb_freed);
 }
 
-static int __init acornfb_probe(struct platform_device *dev)
+static int __devinit acornfb_probe(struct platform_device *dev)
 {
 	unsigned long size;
 	u_int h_sync, v_sync;
-- 
1.6.6

^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 02/29] move am79c961's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
  2010-01-22 23:49                                       ` Dmitry Torokhov
  2010-01-23 20:35                                         ` Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 03/29] move arcfb's " Uwe Kleine-König
                                                         ` (27 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Roel Kluin, Russell King, netdev, Andrew Morton

A pointer to am79c961_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: netdev@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/net/arm/am79c961a.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index 164b37e..1c3c1f9 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -680,7 +680,7 @@ static const struct net_device_ops am79c961_netdev_ops = {
 #endif
 };
 
-static int __init am79c961_probe(struct platform_device *pdev)
+static int __devinit am79c961_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct net_device *dev;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 03/29] move arcfb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (2 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 02/29] move am79c961's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 04/29] move cfag12864bfb's " Uwe Kleine-König
                                                         ` (26 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Antonino Daplas, Andrew Morton

A pointer to arcfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/arcfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index c343169..01554d6 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -504,7 +504,7 @@ static struct fb_ops arcfb_ops = {
 	.fb_ioctl 	= arcfb_ioctl,
 };
 
-static int __init arcfb_probe(struct platform_device *dev)
+static int __devinit arcfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int retval = -ENOMEM;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 04/29] move cfag12864bfb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (3 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 03/29] move arcfb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 05/29] move cobalt-lcd's " Uwe Kleine-König
                                                         ` (25 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Andrew Morton, Avuton Olrich, Antonino Daplas

A pointer to cfag12864bfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Avuton Olrich <avuton@gmail.com>
Cc: Antonino Daplas <adaplas@gmail.com>
---
 drivers/auxdisplay/cfag12864bfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c
index fe3a865..b0ca5a4 100644
--- a/drivers/auxdisplay/cfag12864bfb.c
+++ b/drivers/auxdisplay/cfag12864bfb.c
@@ -81,7 +81,7 @@ static struct fb_ops cfag12864bfb_ops = {
 	.fb_mmap = cfag12864bfb_mmap,
 };
 
-static int __init cfag12864bfb_probe(struct platform_device *device)
+static int __devinit cfag12864bfb_probe(struct platform_device *device)
 {
 	int ret = -EINVAL;
  	struct fb_info *info = framebuffer_alloc(0, &device->dev);
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 05/29] move cobalt-lcd's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (4 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 04/29] move cfag12864bfb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 06/29] move corgi-ssp's " Uwe Kleine-König
                                                         ` (24 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Yoichi Yuasa, Krzysztof Helt, Antonino Daplas,
	Andrew Morton

A pointer to cobalt_lcdfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Antonino Daplas <adaplas@pol.net>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/cobalt_lcdfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/cobalt_lcdfb.c b/drivers/video/cobalt_lcdfb.c
index 108b89e..5eb61b5 100644
--- a/drivers/video/cobalt_lcdfb.c
+++ b/drivers/video/cobalt_lcdfb.c
@@ -287,7 +287,7 @@ static struct fb_ops cobalt_lcd_fbops = {
 	.fb_cursor	= cobalt_lcdfb_cursor,
 };
 
-static int __init cobalt_lcdfb_probe(struct platform_device *dev)
+static int __devinit cobalt_lcdfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct resource *res;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 06/29] move corgi-ssp's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (5 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 05/29] move cobalt-lcd's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 07/29] move efifb's " Uwe Kleine-König
                                                         ` (23 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Eric Miao, Russell King, Paul Sokolovsky,
	Richard Purdie, Liam Girdwood, Andrew Morton

A pointer to corgi_ssp_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (when having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Eric Miao <eric.miao@marvell.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Paul Sokolovsky <pmiscml@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 arch/arm/mach-pxa/corgi_ssp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index a5ee707..1d9bc11 100644
--- a/arch/arm/mach-pxa/corgi_ssp.c
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -204,7 +204,7 @@ void __init corgi_ssp_set_machinfo(struct corgissp_machinfo *machinfo)
 	ssp_machinfo = machinfo;
 }
 
-static int __init corgi_ssp_probe(struct platform_device *dev)
+static int __devinit corgi_ssp_probe(struct platform_device *dev)
 {
 	int ret;
 
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 07/29] move efifb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (6 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 06/29] move corgi-ssp's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-26 16:20                                         ` Peter Jones
  2010-01-23 20:35                                       ` [PATCH 08/29] move epson1355fb's " Uwe Kleine-König
                                                         ` (22 subsequent siblings)
  30 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Peter Jones, Krzysztof Helt, Geert Uytterhoeven,
	Jaya Kumar, Ralf Baechle, Maciej W. Rozycki, Andrew Morton,
	Chandramouli Narayanan, Huang Ying

A pointer to efifb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Peter Jones <pjones@redhat.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Chandramouli Narayanan <mouli@linux.intel.com>
Cc: Huang Ying <ying.huang@intel.com>
---
 drivers/video/efifb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index eb12182..2161f21 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -201,7 +201,7 @@ static int __init efifb_setup(char *options)
 	return 0;
 }
 
-static int __init efifb_probe(struct platform_device *dev)
+static int __devinit efifb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int err;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 08/29] move epson1355fb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (7 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 07/29] move efifb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 09/29] move gbefb's " Uwe Kleine-König
                                                         ` (21 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Russell King, Krzysztof Helt, Antonino Daplas,
	Andrew Morton, Paul Mundt, Roland Stigge, Greg Kroah-Hartman

A pointer to epson1355fb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Roland Stigge <stigge@antcom.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/video/epson1355fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c
index 2735b79..6d755bb 100644
--- a/drivers/video/epson1355fb.c
+++ b/drivers/video/epson1355fb.c
@@ -602,7 +602,7 @@ static int epson1355fb_remove(struct platform_device *dev)
 	return 0;
 }
 
-int __init epson1355fb_probe(struct platform_device *dev)
+int __devinit epson1355fb_probe(struct platform_device *dev)
 {
 	struct epson1355_par *default_par;
 	struct fb_info *info;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 09/29] move gbefb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (8 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 08/29] move epson1355fb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 10/29] move h1940-bt's " Uwe Kleine-König
                                                         ` (20 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Roel Kluin, Krzysztof Helt, Thomas Bogendoerfer,
	Andrew Morton, Antonino Daplas, Kaj-Michael Lang,
	Martin Michlmayr, Joshua Kinard

A pointer to gbefb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Roel Kluin <roel.kluin@gmail.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Antonino Daplas <adaplas@pol.net>
Cc: Kaj-Michael Lang <milang@tal.org>
Cc: Martin Michlmayr <tbm@cyrius.com>
Cc: Joshua Kinard <kumba@gentoo.org>
---
 drivers/video/gbefb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index 695fa01..5643a35 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -1128,7 +1128,7 @@ static int __init gbefb_setup(char *options)
 	return 0;
 }
 
-static int __init gbefb_probe(struct platform_device *p_dev)
+static int __devinit gbefb_probe(struct platform_device *p_dev)
 {
 	int i, ret = 0;
 	struct fb_info *info;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 10/29] move h1940-bt's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (9 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 09/29] move gbefb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 11/29] move hgafb's " Uwe Kleine-König
                                                         ` (19 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Russell King, Arnaud Patard, Ben Dooks, Andrew Morton

A pointer to h1940bt_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 arch/arm/mach-s3c2410/h1940-bluetooth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c
index b7d1f8d..a3f3c7b 100644
--- a/arch/arm/mach-s3c2410/h1940-bluetooth.c
+++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c
@@ -56,7 +56,7 @@ static const struct rfkill_ops h1940bt_rfkill_ops = {
 	.set_block = h1940bt_set_block,
 };
 
-static int __init h1940bt_probe(struct platform_device *pdev)
+static int __devinit h1940bt_probe(struct platform_device *pdev)
 {
 	struct rfkill *rfk;
 	int ret = 0;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 11/29] move hgafb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (10 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 10/29] move h1940-bt's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 12/29] move hitfb's " Uwe Kleine-König
                                                         ` (18 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Krzysztof Helt, Andrew Morton, Anton Vorontsov,
	Antonino Daplas

A pointer to hgafb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Antonino Daplas <adaplas@pol.net>
---
 drivers/video/hgafb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c
index 0129c04..db9b785 100644
--- a/drivers/video/hgafb.c
+++ b/drivers/video/hgafb.c
@@ -551,7 +551,7 @@ static struct fb_ops hgafb_ops = {
 	 *  Initialization
 	 */
 
-static int __init hgafb_probe(struct platform_device *pdev)
+static int __devinit hgafb_probe(struct platform_device *pdev)
 {
 	struct fb_info *info;
 
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 12/29] move hitfb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (11 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 11/29] move hgafb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 13/29] move hp-wmi's " Uwe Kleine-König
                                                         ` (17 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Paul Mundt, Andriy Skulysh, Antonino Daplas, Andrew Morton

A pointer to hitfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Andriy Skulysh <askulysh@gmail.com>
Cc: Antonino Daplas <adaplas@pol.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/hitfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c
index 73c83a8..bf78779 100644
--- a/drivers/video/hitfb.c
+++ b/drivers/video/hitfb.c
@@ -325,7 +325,7 @@ static struct fb_ops hitfb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static int __init hitfb_probe(struct platform_device *dev)
+static int __devinit hitfb_probe(struct platform_device *dev)
 {
 	unsigned short lcdclor, ldr3, ldvndr;
 	struct fb_info *info;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 13/29] move hp-wmi's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (12 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 12/29] move hitfb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 14/29] move jornada_ssp's " Uwe Kleine-König
                                                         ` (16 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Frans Pop, Larry Finger, Len Brown, Helge Deller,
	Matthew Garrett, Andrew Morton

A pointer to hp_wmi_bios_setup is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Frans Pop <elendil@planet.nl>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Len Brown <lenb@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/platform/x86/hp-wmi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index ad4c414..5c7259a 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -57,7 +57,7 @@ enum hp_wmi_radio {
 	HPWMI_WWAN = 2,
 };
 
-static int __init hp_wmi_bios_setup(struct platform_device *device);
+static int __devinit hp_wmi_bios_setup(struct platform_device *device);
 static int __exit hp_wmi_bios_remove(struct platform_device *device);
 static int hp_wmi_resume_handler(struct device *device);
 
@@ -446,7 +446,7 @@ static void cleanup_sysfs(struct platform_device *device)
 	device_remove_file(&device->dev, &dev_attr_tablet);
 }
 
-static int __init hp_wmi_bios_setup(struct platform_device *device)
+static int __devinit hp_wmi_bios_setup(struct platform_device *device)
 {
 	int err;
 	int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0);
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 14/29] move jornada_ssp's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (13 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 13/29] move hp-wmi's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 15/29] move omap24xxcam's " Uwe Kleine-König
                                                         ` (15 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Russell King, Andrew Morton

A pointer to jornada_ssp_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 arch/arm/mach-sa1100/jornada720_ssp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c
index 506a5e5..9b6dee5 100644
--- a/arch/arm/mach-sa1100/jornada720_ssp.c
+++ b/arch/arm/mach-sa1100/jornada720_ssp.c
@@ -130,7 +130,7 @@ void jornada_ssp_end(void)
 };
 EXPORT_SYMBOL(jornada_ssp_end);
 
-static int __init jornada_ssp_probe(struct platform_device *dev)
+static int __devinit jornada_ssp_probe(struct platform_device *dev)
 {
 	int ret;
 
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 15/29] move omap24xxcam's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (14 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 14/29] move jornada_ssp's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 16/29] move omap_hdq's " Uwe Kleine-König
                                                         ` (14 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Hans Verkuil, Mauro Carvalho Chehab, Andrew Morton

A pointer to omap24xxcam_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Acked-by: Trilok Soni <soni.trilok@gmail.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/media/video/omap24xxcam.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c
index 7400eac..142c327 100644
--- a/drivers/media/video/omap24xxcam.c
+++ b/drivers/media/video/omap24xxcam.c
@@ -1735,7 +1735,7 @@ static struct v4l2_int_device omap24xxcam = {
  *
  */
 
-static int __init omap24xxcam_probe(struct platform_device *pdev)
+static int __devinit omap24xxcam_probe(struct platform_device *pdev)
 {
 	struct omap24xxcam_device *cam;
 	struct resource *mem;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 16/29] move omap_hdq's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (15 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 15/29] move omap24xxcam's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 17/29] move i2c_omap's " Uwe Kleine-König
                                                         ` (13 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Stanley.Miao, Andrew Morton,
	Madhusudhan Chikkature, Felipe Balbi

A pointer to omap_hdq_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Stanley.Miao <stanley.miao@windriver.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
---
 drivers/w1/masters/omap_hdq.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 0d92969..22977d3 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -72,7 +72,7 @@ struct hdq_data {
 	int			init_trans;
 };
 
-static int __init omap_hdq_probe(struct platform_device *pdev);
+static int __devinit omap_hdq_probe(struct platform_device *pdev);
 static int omap_hdq_remove(struct platform_device *pdev);
 
 static struct platform_driver omap_hdq_driver = {
@@ -558,7 +558,7 @@ static void omap_w1_write_byte(void *_hdq, u8 byte)
 	return;
 }
 
-static int __init omap_hdq_probe(struct platform_device *pdev)
+static int __devinit omap_hdq_probe(struct platform_device *pdev)
 {
 	struct hdq_data *hdq_data;
 	struct resource *res;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 17/29] move i2c_omap's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (16 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 16/29] move omap_hdq's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 18/29] move q40fb's " Uwe Kleine-König
                                                         ` (12 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Kalle Jokiniemi, Tony Lindgren, Paul Walmsley,
	Richard Woodruff, chandra shekhar, Jason P Marini,
	Syed Mohammed Khasim, Jarkko Nikula, Juha Yrjola, Andrew Morton

A pointer to omap_i2c_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Kalle Jokiniemi <ext-kalle.jokiniemi@nokia.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
Cc: chandra shekhar <x0044955@ti.com>
Cc: Jason P Marini <jason.marini@gmail.com>
Cc: Syed Mohammed Khasim  <x0khasim@ti.com>
Cc: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: Juha Yrjola <juha.yrjola@solidboot.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/i2c/busses/i2c-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 0037e31..bd86a85 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -849,7 +849,7 @@ static const struct i2c_algorithm omap_i2c_algo = {
 	.functionality	= omap_i2c_func,
 };
 
-static int __init
+static int __devinit
 omap_i2c_probe(struct platform_device *pdev)
 {
 	struct omap_i2c_dev	*dev;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 18/29] move q40fb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (17 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 17/29] move i2c_omap's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 19/29] move s3c241xfb's " Uwe Kleine-König
                                                         ` (11 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Antonino Daplas, Andrew Morton

A pointer to q40fb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/q40fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c
index 4beac1d..de40a62 100644
--- a/drivers/video/q40fb.c
+++ b/drivers/video/q40fb.c
@@ -85,7 +85,7 @@ static struct fb_ops q40fb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static int __init q40fb_probe(struct platform_device *dev)
+static int __devinit q40fb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 19/29] move s3c241xfb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (18 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 18/29] move q40fb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 20/29] move sa11x0-fb's " Uwe Kleine-König
                                                         ` (10 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Russell King, Ben Dooks, Arnaud Patard,
	Krzysztof Helt, Andrew Morton, Antonino Daplas, Vincent Sanders

Pointers to s3c2410fb_probe and s3c2412fb_probe are passed to the core
via platform_driver_register and so the functions must not disappear
when the .init sections are discarded.  Otherwise (if also having
HOTPLUG=y) unbinding and binding a device to one of the drivers via
sysfs will result in an oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Antonino Daplas <adaplas@pol.net>
Cc: Vincent Sanders <vince@simtec.co.uk>
---
 drivers/video/s3c2410fb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index aac6612..2b094de 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -1004,12 +1004,12 @@ dealloc_fb:
 	return ret;
 }
 
-static int __init s3c2410fb_probe(struct platform_device *pdev)
+static int __devinit s3c2410fb_probe(struct platform_device *pdev)
 {
 	return s3c24xxfb_probe(pdev, DRV_S3C2410);
 }
 
-static int __init s3c2412fb_probe(struct platform_device *pdev)
+static int __devinit s3c2412fb_probe(struct platform_device *pdev)
 {
 	return s3c24xxfb_probe(pdev, DRV_S3C2412);
 }
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 20/29] move sa11x0-fb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (19 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 19/29] move s3c241xfb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 21/29] move sgivwfb's " Uwe Kleine-König
                                                         ` (9 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Russell King, Matthias Kaehlcke, Andrew Morton,
	Antonino Daplas, Pavel Machek, Christoph Hellwig

A pointer to sa1100fb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Matthias Kaehlcke <matthias@kaehlcke.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Pavel Machek <pavel@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>
---
 drivers/video/sa1100fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index cdaa873..e8b76d6 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -1435,7 +1435,7 @@ static struct sa1100fb_info * __init sa1100fb_init_fbinfo(struct device *dev)
 	return fbi;
 }
 
-static int __init sa1100fb_probe(struct platform_device *pdev)
+static int __devinit sa1100fb_probe(struct platform_device *pdev)
 {
 	struct sa1100fb_info *fbi;
 	int ret, irq;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 21/29] move sgivwfb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (20 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 20/29] move sa11x0-fb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 22/29] move sgiwd93's " Uwe Kleine-König
                                                         ` (8 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Antonino Daplas, Andrew Morton, Adrian Bunk,
	Christoph Hellwig

A pointer to sgivwfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Adrian Bunk <bunk@stusta.de>
Cc: Christoph Hellwig <hch@lst.de>
---
 drivers/video/sgivwfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c
index f860122..7a3a5e2 100644
--- a/drivers/video/sgivwfb.c
+++ b/drivers/video/sgivwfb.c
@@ -745,7 +745,7 @@ int __init sgivwfb_setup(char *options)
 /*
  *  Initialisation
  */
-static int __init sgivwfb_probe(struct platform_device *dev)
+static int __devinit sgivwfb_probe(struct platform_device *dev)
 {
 	struct sgivw_par *par;
 	struct fb_info *info;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 22/29] move sgiwd93's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (21 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 21/29] move sgivwfb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 23/29] move sharpsl-pm's " Uwe Kleine-König
                                                         ` (7 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Dmitri Vorobiev, James Bottomley,
	Thomas Bogendoerfer, Andrew Morton, peter fuerst,
	Henrik Kretzschmar

A pointer to sgiwd93_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: peter fuerst <post@pfrst.de>
Cc: Henrik Kretzschmar <henne@nachtwindheim.de>
---
 drivers/scsi/sgiwd93.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index 0807b26..fef0e3c 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -226,7 +226,7 @@ static struct scsi_host_template sgiwd93_template = {
 	.use_clustering		= DISABLE_CLUSTERING,
 };
 
-static int __init sgiwd93_probe(struct platform_device *pdev)
+static int __devinit sgiwd93_probe(struct platform_device *pdev)
 {
 	struct sgiwd93_platform_data *pd = pdev->dev.platform_data;
 	unsigned char *wdregs = pd->wdregs;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 23/29] move sharpsl-pm's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (22 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 22/29] move sgiwd93's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 24/29] move sh_mobile_lcdc_fb's " Uwe Kleine-König
                                                         ` (6 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Dmitry Baryshkov, Russell King, Andrew Morton

A pointer to sharpsl_pm_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Eric Miao <eric.miao@marvell.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 arch/arm/mach-pxa/sharpsl_pm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index 67229a1..463d874 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -900,7 +900,7 @@ static struct platform_suspend_ops sharpsl_pm_ops = {
 };
 #endif
 
-static int __init sharpsl_pm_probe(struct platform_device *pdev)
+static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
 {
 	int ret;
 
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 24/29] move sh_mobile_lcdc_fb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (23 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 23/29] move sharpsl-pm's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 25/29] move snirm_53c710's " Uwe Kleine-König
                                                         ` (5 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Greg Kroah-Hartman, Magnus Damm, Paul Mundt,
	Krzysztof Helt, Andrew Morton

A pointer to sh_mobile_lcdc_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Magnus Damm <damm@igel.co.jp>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/sh_mobile_lcdcfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index a69830d..8f3c786 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -907,7 +907,7 @@ static const struct dev_pm_ops sh_mobile_lcdc_dev_pm_ops = {
 
 static int sh_mobile_lcdc_remove(struct platform_device *pdev);
 
-static int __init sh_mobile_lcdc_probe(struct platform_device *pdev)
+static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
 {
 	struct fb_info *info;
 	struct sh_mobile_lcdc_priv *priv;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 25/29] move snirm_53c710's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (24 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 24/29] move sh_mobile_lcdc_fb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 26/29] move vesafb's " Uwe Kleine-König
                                                         ` (4 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Kay Sievers, David Brownell, Andrew Morton,
	James Bottomley, Thomas Bogendoerfer

A pointer to snirm710_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
 drivers/scsi/sni_53c710.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sni_53c710.c b/drivers/scsi/sni_53c710.c
index 37b3359..56cf0bb 100644
--- a/drivers/scsi/sni_53c710.c
+++ b/drivers/scsi/sni_53c710.c
@@ -64,7 +64,7 @@ static struct scsi_host_template snirm710_template = {
 	.module		= THIS_MODULE,
 };
 
-static int __init snirm710_probe(struct platform_device *dev)
+static int __devinit snirm710_probe(struct platform_device *dev)
 {
 	unsigned long base;
 	struct NCR_700_Host_Parameters *hostdata;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 26/29] move vesafb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (25 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 25/29] move snirm_53c710's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 27/29] move vfb's " Uwe Kleine-König
                                                         ` (3 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Helge Deller, James Simmons, Andrew Morton,
	Antonino Daplas

A pointer to vesafb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Helge Deller <deller@gmx.de>
Cc: James Simmons <jsimmons@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Antonino Daplas <adaplas@pol.net>
---
 drivers/video/vesafb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index bd37ee1..ef4128c 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -226,7 +226,7 @@ static int __init vesafb_setup(char *options)
 	return 0;
 }
 
-static int __init vesafb_probe(struct platform_device *dev)
+static int __devinit vesafb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int i, err;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 27/29] move vfb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (26 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 26/29] move vesafb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 28/29] move vga16fb's " Uwe Kleine-König
                                                         ` (2 subsequent siblings)
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Frans Pop, Antonino Daplas, Krzysztof Helt, Andrew Morton

A pointer to vfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Frans Pop <elendil@planet.nl>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/vfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index 050d432..b8ab995 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -479,7 +479,7 @@ static int __init vfb_setup(char *options)
      *  Initialisation
      */
 
-static int __init vfb_probe(struct platform_device *dev)
+static int __devinit vfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int retval = -ENOMEM;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 28/29] move vga16fb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (27 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 27/29] move vfb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-23 20:35                                       ` [PATCH 29/29] move w100fb's " Uwe Kleine-König
  2010-01-24 21:09                                       ` [PATCH] platform_driver_register: warn if probe is in .init.text OGAWA Hirofumi
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Krzysztof Helt, Roel Kluin, Antonino Daplas, Andrew Morton

A pointer to vga16fb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Antonino Daplas <adaplas@pol.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/vga16fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
index 5b29389..76d8dae 100644
--- a/drivers/video/vga16fb.c
+++ b/drivers/video/vga16fb.c
@@ -1293,7 +1293,7 @@ static int vga16fb_setup(char *options)
 }
 #endif
 
-static int __init vga16fb_probe(struct platform_device *dev)
+static int __devinit vga16fb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct vga16fb_par *par;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 29/29] move w100fb's probe function to .devinit.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (28 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 28/29] move vga16fb's " Uwe Kleine-König
@ 2010-01-23 20:35                                       ` Uwe Kleine-König
  2010-01-24 21:09                                       ` [PATCH] platform_driver_register: warn if probe is in .init.text OGAWA Hirofumi
  30 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-23 20:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Philipp Zabel, Ian Molton, Richard Purdie,
	Antonino Daplas, Alberto Mardegan, Andrew Morton

A pointer to w100fb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Cc: Ian Molton <spyro@f2s.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Alberto Mardegan <mardy@users.sourceforge.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/w100fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
index 2376f68..5d22395 100644
--- a/drivers/video/w100fb.c
+++ b/drivers/video/w100fb.c
@@ -628,7 +628,7 @@ static int w100fb_resume(struct platform_device *dev)
 #endif
 
 
-int __init w100fb_probe(struct platform_device *pdev)
+int __devinit w100fb_probe(struct platform_device *pdev)
 {
 	int err = -EIO;
 	struct w100fb_mach_info *inf;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* Re: [PATCH 01/29] move acornfb's probe function to .devinit.text
  2010-01-23 20:35                                         ` Uwe Kleine-König
  (?)
@ 2010-01-23 23:25                                         ` Alexey Dobriyan
  -1 siblings, 0 replies; 197+ messages in thread
From: Alexey Dobriyan @ 2010-01-23 23:25 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Christoph Hellwig, Antonino Daplas,
	linux-fbdev-devel, Andrew Morton

On Sat, Jan 23, 2010 at 09:35:09PM +0100, Uwe Kleine-König wrote:
>  drivers/video/acornfb.c |    2 +-

gods, can you just send one patch for all framebuffer drivers?

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 01/29] move acornfb's probe function to .devinit.text
  2010-01-23 20:35                                         ` Uwe Kleine-König
  (?)
  (?)
@ 2010-01-23 23:28                                         ` Alexey Dobriyan
  2010-01-26  8:46                                           ` Uwe Kleine-König
  -1 siblings, 1 reply; 197+ messages in thread
From: Alexey Dobriyan @ 2010-01-23 23:28 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Christoph Hellwig, Antonino Daplas,
	linux-fbdev-devel, Andrew Morton

On Sat, Jan 23, 2010 at 09:35:09PM +0100, Uwe Kleine-König wrote:
> -static int __init acornfb_probe(struct platform_device *dev)
> +static int __devinit acornfb_probe(struct platform_device *dev)

Even more, if this function is marked __devinit, some other functions
can very well be marked __devinit, can you do this?

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-22 19:49                                     ` Uwe Kleine-König
                                                         ` (29 preceding siblings ...)
  2010-01-23 20:35                                       ` [PATCH 29/29] move w100fb's " Uwe Kleine-König
@ 2010-01-24 21:09                                       ` OGAWA Hirofumi
  2010-01-26  8:47                                         ` Uwe Kleine-König
  30 siblings, 1 reply; 197+ messages in thread
From: OGAWA Hirofumi @ 2010-01-24 21:09 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Greg KH, linux-kernel

Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:

> +int platform_driver_register(struct platform_driver *drv)
> +{
> +	int ret = __platform_driver_register(drv);
> +
> +#if defined(CONFIG_HOTPLUG)
> +	/*
> +	 * drivers that are registered by platform_driver_register
> +	 * should not have their probe function in .init.text.  The
> +	 * reason is that a probe can happen after .init.text is
> +	 * discarded which then results in an oops.  The alternatives
> +	 * are using .devinit.text for the probe function or "register"
> +	 * with platform_driver_probe.
> +	 */
> +	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
> +		pr_warning("oops-warning: probe function of platform driver %s"
> +			       " lives in .init.text\n", drv->driver.name);
> +#else
> +	/*
> +	 * without HOTPLUG probe functions can be discarded after the driver is
> +	 * loaded.
> +	 * There is a little chance for false positives, namely if the driver is
> +	 * registered after the .init sections are discarded.
> +	 */
> +	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
> +		pr_info("probably the probe function of platform driver %s can"
> +				" be moved to .init.text\n", drv->driver.name);
> +#endif
> +	return ret;
> +}

Um..., can't we extend modpost or such one for this? I think the static
analysis is better (assume the changing ->probe dynamically is really
rare).

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-23  9:49                                         ` Uwe Kleine-König
@ 2010-01-25 17:14                                           ` Dmitry Torokhov
  2010-01-25 19:25                                             ` Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Dmitry Torokhov @ 2010-01-25 17:14 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Greg KH, linux-kernel

On Sat, Jan 23, 2010 at 10:49:16AM +0100, Uwe Kleine-König wrote:
> Helle Dmitry,
> 
> On Fri, Jan 22, 2010 at 03:49:37PM -0800, Dmitry Torokhov wrote:
> > On Fri, Jan 22, 2010 at 08:49:18PM +0100, Uwe Kleine-König wrote:
> > > +int platform_driver_register(struct platform_driver *drv)
> > > +{
> > > +	int ret = __platform_driver_register(drv);
> > > +
> > > +#if defined(CONFIG_HOTPLUG)
> > > +	/*
> > > +	 * drivers that are registered by platform_driver_register
> > > +	 * should not have their probe function in .init.text.  The
> > > +	 * reason is that a probe can happen after .init.text is
> > > +	 * discarded which then results in an oops.  The alternatives
> > > +	 * are using .devinit.text for the probe function or "register"
> > > +	 * with platform_driver_probe.
> > > +	 */
> > 
> > 
> > What about CONFIG_MODULE case (without hotplug)? The driver may be
> > compiled in (and thus probe will be discarded) but device might be
> > created by a loadable module which is loaded later.
> I don't see the problem here.

You are right, without hotplug we don't try to bind to devices that
come in later so we are safe to discard probe.

>  If the driver is registered using
> platform_driver_register and the probe function lives in .init.text it
> doesn't matter where the device comes from.  If there is one you can
> unbind and bind at a later time when .init is already discarded.  No?
> 

Yes.

> More general, using platform_driver_register the pointer to the probe
> function have to stay valid as it is saved for later use, so it must not
> be an .init pointer.


> 
> > > +	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
> > > +		pr_warning("oops-warning: probe function of platform driver %s"
> > > +			       " lives in .init.text\n", drv->driver.name);
> > > +#else
> > > +	/*
> > > +	 * without HOTPLUG probe functions can be discarded after the driver is
> > > +	 * loaded.
> > > +	 * There is a little chance for false positives, namely if the driver is
> > > +	 * registered after the .init sections are discarded.
> > > +	 */
> > > +	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
> > > +		pr_info("probably the probe function of platform driver %s can"
> > > +				" be moved to .init.text\n", drv->driver.name);
> > 
> > It really depends on the user's (or rather builder's) local
> > configuration so how can we make this suggestion?
> Can you point out a situation that makes the suggestion wrong?  AFAIK
> there only the possibility that the driver is loaded after .init is
> discarded (as written in the comment).
> 

The presence of CONFIG_HOTPLUG depends on particular .config, so, for
example, you may not have it set while I have. So you will boot, get the
suggestion, submit a patch, then I will boot and will get a warning that
the probe function is in wrong section.

So in general I wonder if it is possible to request that all probe
functions are marked as __devinit or not marked at all, regardless of
CONFIG_HOTPLUG and CONFIG_MODULE settings.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-25 17:14                                           ` Dmitry Torokhov
@ 2010-01-25 19:25                                             ` Uwe Kleine-König
  2010-01-25 19:31                                               ` Dmitry Torokhov
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-25 19:25 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Greg KH, linux-kernel

Hello Dmitry,

> > > > +	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
> > > > +		pr_warning("oops-warning: probe function of platform driver %s"
> > > > +			       " lives in .init.text\n", drv->driver.name);
> > > > +#else
> > > > +	/*
> > > > +	 * without HOTPLUG probe functions can be discarded after the driver is
> > > > +	 * loaded.
> > > > +	 * There is a little chance for false positives, namely if the driver is
> > > > +	 * registered after the .init sections are discarded.
> > > > +	 */
> > > > +	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
> > > > +		pr_info("probably the probe function of platform driver %s can"
> > > > +				" be moved to .init.text\n", drv->driver.name);
> > > 
> > > It really depends on the user's (or rather builder's) local
> > > configuration so how can we make this suggestion?
> > Can you point out a situation that makes the suggestion wrong?  AFAIK
> > there only the possibility that the driver is loaded after .init is
> > discarded (as written in the comment).
> > 
> 
> The presence of CONFIG_HOTPLUG depends on particular .config, so, for
> example, you may not have it set while I have. So you will boot, get the
> suggestion, submit a patch, then I will boot and will get a warning that
> the probe function is in wrong section.
> 
> So in general I wonder if it is possible to request that all probe
> functions are marked as __devinit or not marked at all, regardless of
> CONFIG_HOTPLUG and CONFIG_MODULE settings.
Would you agree if the message would change to

	probably the probe function of platform driver %s can be moved
	to .devinit.text

?

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-25 19:25                                             ` Uwe Kleine-König
@ 2010-01-25 19:31                                               ` Dmitry Torokhov
  0 siblings, 0 replies; 197+ messages in thread
From: Dmitry Torokhov @ 2010-01-25 19:31 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Greg KH, linux-kernel

On Mon, Jan 25, 2010 at 08:25:40PM +0100, Uwe Kleine-König wrote:
> Hello Dmitry,
> 
> > > > > +	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
> > > > > +		pr_warning("oops-warning: probe function of platform driver %s"
> > > > > +			       " lives in .init.text\n", drv->driver.name);
> > > > > +#else
> > > > > +	/*
> > > > > +	 * without HOTPLUG probe functions can be discarded after the driver is
> > > > > +	 * loaded.
> > > > > +	 * There is a little chance for false positives, namely if the driver is
> > > > > +	 * registered after the .init sections are discarded.
> > > > > +	 */
> > > > > +	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
> > > > > +		pr_info("probably the probe function of platform driver %s can"
> > > > > +				" be moved to .init.text\n", drv->driver.name);
> > > > 
> > > > It really depends on the user's (or rather builder's) local
> > > > configuration so how can we make this suggestion?
> > > Can you point out a situation that makes the suggestion wrong?  AFAIK
> > > there only the possibility that the driver is loaded after .init is
> > > discarded (as written in the comment).
> > > 
> > 
> > The presence of CONFIG_HOTPLUG depends on particular .config, so, for
> > example, you may not have it set while I have. So you will boot, get the
> > suggestion, submit a patch, then I will boot and will get a warning that
> > the probe function is in wrong section.
> > 
> > So in general I wonder if it is possible to request that all probe
> > functions are marked as __devinit or not marked at all, regardless of
> > CONFIG_HOTPLUG and CONFIG_MODULE settings.
> Would you agree if the message would change to
> 
> 	probably the probe function of platform driver %s can be moved
> 	to .devinit.text
> 
> ?

How about "Consider marking the probe function as '__devinit'"?

-- 
Dmitry

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 01/29] move acornfb's probe function to .devinit.text
  2010-01-23 23:28                                         ` Alexey Dobriyan
@ 2010-01-26  8:46                                           ` Uwe Kleine-König
  0 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-26  8:46 UTC (permalink / raw)
  To: Alexey Dobriyan
  Cc: Greg KH, linux-kernel, Christoph Hellwig, Antonino Daplas,
	linux-fbdev-devel, Andrew Morton

On Sun, Jan 24, 2010 at 01:25:58 +0200, Alexey Dobriyan wrote:
> gods, can you just send one patch for all framebuffer drivers?
Well, I thought one logical change per changeset is the favourite way to
go.  And as the people Cc:d are different I think most people prefer it
this way.

On Sun, Jan 24, 2010 at 01:28:13AM +0200, Alexey Dobriyan wrote:
> On Sat, Jan 23, 2010 at 09:35:09PM +0100, Uwe Kleine-König wrote:
> > -static int __init acornfb_probe(struct platform_device *dev)
> > +static int __devinit acornfb_probe(struct platform_device *dev)
> 
> Even more, if this function is marked __devinit, some other functions
> can very well be marked __devinit, can you do this?
Probably, the big pro after my patch is that modpost can warn about
this.  Actually this applies to all (initially) over 50 patches in this
series.  If you take my patches, squash them together and fix all called
functions, I'm happy, too.

If you don't I might come back to this and do it myself.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-24 21:09                                       ` [PATCH] platform_driver_register: warn if probe is in .init.text OGAWA Hirofumi
@ 2010-01-26  8:47                                         ` Uwe Kleine-König
  2010-01-28  1:14                                           ` Greg KH
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-26  8:47 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: Greg KH, linux-kernel

Hello,

On Mon, Jan 25, 2010 at 06:09:01AM +0900, OGAWA Hirofumi wrote:
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> 
> > +int platform_driver_register(struct platform_driver *drv)
> > +{
> > +	int ret = __platform_driver_register(drv);
> > +
> > +#if defined(CONFIG_HOTPLUG)
> > +	/*
> > +	 * drivers that are registered by platform_driver_register
> > +	 * should not have their probe function in .init.text.  The
> > +	 * reason is that a probe can happen after .init.text is
> > +	 * discarded which then results in an oops.  The alternatives
> > +	 * are using .devinit.text for the probe function or "register"
> > +	 * with platform_driver_probe.
> > +	 */
> > +	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
> > +		pr_warning("oops-warning: probe function of platform driver %s"
> > +			       " lives in .init.text\n", drv->driver.name);
> > +#else
> > +	/*
> > +	 * without HOTPLUG probe functions can be discarded after the driver is
> > +	 * loaded.
> > +	 * There is a little chance for false positives, namely if the driver is
> > +	 * registered after the .init sections are discarded.
> > +	 */
> > +	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
> > +		pr_info("probably the probe function of platform driver %s can"
> > +				" be moved to .init.text\n", drv->driver.name);
> > +#endif
> > +	return ret;
> > +}
> 
> Um..., can't we extend modpost or such one for this? I think the static
> analysis is better (assume the changing ->probe dynamically is really
> rare).
I like the idea and will look later into modpost if this can be done
there.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2010-01-22 17:38                                   ` Greg KH
  2010-01-22 19:49                                     ` Uwe Kleine-König
@ 2010-01-26  8:59                                     ` Uwe Kleine-König
  2010-01-26 14:30                                       ` Greg KH
  2010-01-28 18:02                                       ` Greg KH
  1 sibling, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-26  8:59 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Hello Greg,

On Fri, Jan 22, 2010 at 09:38:46AM -0800, Greg KH wrote:
> On Fri, Jan 22, 2010 at 06:06:41PM +0100, Uwe Kleine-König wrote:
> > Hello,
> > 
> > On Mon, Sep 07, 2009 at 04:19:41PM +0200, Uwe Kleine-König wrote:
> > > Hi Greg,
> > > 
> > > On Sat, Jul 11, 2009 at 10:05:48AM -0700, Greg KH wrote:
> > > > On Sat, Jul 11, 2009 at 12:00:14PM +0200, Uwe Kleine-König wrote:
> > > > > Hi Greg,
> > > > > 
> > > > > > > Are you conviced and took the patch or did you give up to convince me?
> > > > > > 
> > > > > > Heh, no, sorry, it got burried in my queue.
> > > > > > 
> > > > > > > I still think the patch is correct and I'd like to have it applied.
> > > > > > 
> > > > > > Ok, let's test it out in the linux-next tree for a while to make sure it
> > > > > > works properly.  Care to send me an updated version?
> > > > > I updated to latest Linus' master.  It applies to linux-next from
> > > > > Fri Jul 10 14:44:30 2009 +1000 as is.
> > > > 
> > > > Thanks, I'll apply it later today to my trees.
> > > ping?!
> > > 
> > > > > Back some time I sent a series that fixes many of these bugs.  I will
> > > > > update it later today and resend.
> > > > 
> > > > Thanks, that would be good to have, to keep the noise down for devices
> > > > we already know about.
> > ping?  I assume you don't have the original mails anymore, so should I
> > resend?
> 
> Yes, sorry.
I would really appreciate if you'd take the patches as it is quite some
work to update and verify the patches are still needed as changing
platform_driver_register to platform_driver_probe doesn't conflict with
this series.

So can you please look into that before they are swapped out of your
inbox the third(?) time?

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2010-01-26  8:59                                     ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
@ 2010-01-26 14:30                                       ` Greg KH
  2010-01-28 18:02                                       ` Greg KH
  1 sibling, 0 replies; 197+ messages in thread
From: Greg KH @ 2010-01-26 14:30 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-kernel

On Tue, Jan 26, 2010 at 09:59:28AM +0100, Uwe Kleine-König wrote:
> Hello Greg,
> 
> On Fri, Jan 22, 2010 at 09:38:46AM -0800, Greg KH wrote:
> > On Fri, Jan 22, 2010 at 06:06:41PM +0100, Uwe Kleine-König wrote:
> > > Hello,
> > > 
> > > On Mon, Sep 07, 2009 at 04:19:41PM +0200, Uwe Kleine-König wrote:
> > > > Hi Greg,
> > > > 
> > > > On Sat, Jul 11, 2009 at 10:05:48AM -0700, Greg KH wrote:
> > > > > On Sat, Jul 11, 2009 at 12:00:14PM +0200, Uwe Kleine-König wrote:
> > > > > > Hi Greg,
> > > > > > 
> > > > > > > > Are you conviced and took the patch or did you give up to convince me?
> > > > > > > 
> > > > > > > Heh, no, sorry, it got burried in my queue.
> > > > > > > 
> > > > > > > > I still think the patch is correct and I'd like to have it applied.
> > > > > > > 
> > > > > > > Ok, let's test it out in the linux-next tree for a while to make sure it
> > > > > > > works properly.  Care to send me an updated version?
> > > > > > I updated to latest Linus' master.  It applies to linux-next from
> > > > > > Fri Jul 10 14:44:30 2009 +1000 as is.
> > > > > 
> > > > > Thanks, I'll apply it later today to my trees.
> > > > ping?!
> > > > 
> > > > > > Back some time I sent a series that fixes many of these bugs.  I will
> > > > > > update it later today and resend.
> > > > > 
> > > > > Thanks, that would be good to have, to keep the noise down for devices
> > > > > we already know about.
> > > ping?  I assume you don't have the original mails anymore, so should I
> > > resend?
> > 
> > Yes, sorry.
> I would really appreciate if you'd take the patches as it is quite some
> work to update and verify the patches are still needed as changing
> platform_driver_register to platform_driver_probe doesn't conflict with
> this series.
> 
> So can you please look into that before they are swapped out of your
> inbox the third(?) time?

Will do, give me a day or so.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 07/29] move efifb's probe function to .devinit.text
  2010-01-23 20:35                                       ` [PATCH 07/29] move efifb's " Uwe Kleine-König
@ 2010-01-26 16:20                                         ` Peter Jones
  0 siblings, 0 replies; 197+ messages in thread
From: Peter Jones @ 2010-01-26 16:20 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Krzysztof Helt, Geert Uytterhoeven,
	Jaya Kumar, Ralf Baechle, Maciej W. Rozycki, Andrew Morton,
	Chandramouli Narayanan, Huang Ying

On 01/23/2010 03:35 PM, Uwe Kleine-König wrote:
> A pointer to efifb_probe is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.

__devinit looks reasonable enough to me.

Acked-By: Peter Jones <pjones@redhat.com>

> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Peter Jones <pjones@redhat.com>
> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
> Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
> Cc: Jaya Kumar <jayakumar.lkml@gmail.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Maciej W. Rozycki <macro@linux-mips.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Chandramouli Narayanan <mouli@linux.intel.com>
> Cc: Huang Ying <ying.huang@intel.com>
> ---
>  drivers/video/efifb.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
> index eb12182..2161f21 100644
> --- a/drivers/video/efifb.c
> +++ b/drivers/video/efifb.c
> @@ -201,7 +201,7 @@ static int __init efifb_setup(char *options)
>  	return 0;
>  }
>  
> -static int __init efifb_probe(struct platform_device *dev)
> +static int __devinit efifb_probe(struct platform_device *dev)
>  {
>  	struct fb_info *info;
>  	int err;


-- 
        Peter

The trouble with the global village are all the global village idiots.
		-- Paul Ginsparg

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-26  8:47                                         ` Uwe Kleine-König
@ 2010-01-28  1:14                                           ` Greg KH
  2010-01-30 20:44                                             ` Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Greg KH @ 2010-01-28  1:14 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: OGAWA Hirofumi, Greg KH, linux-kernel

On Tue, Jan 26, 2010 at 09:47:41AM +0100, Uwe Kleine-König wrote:
> Hello,
> 
> On Mon, Jan 25, 2010 at 06:09:01AM +0900, OGAWA Hirofumi wrote:
> > Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> > 
> > > +int platform_driver_register(struct platform_driver *drv)
> > > +{
> > > +	int ret = __platform_driver_register(drv);
> > > +
> > > +#if defined(CONFIG_HOTPLUG)
> > > +	/*
> > > +	 * drivers that are registered by platform_driver_register
> > > +	 * should not have their probe function in .init.text.  The
> > > +	 * reason is that a probe can happen after .init.text is
> > > +	 * discarded which then results in an oops.  The alternatives
> > > +	 * are using .devinit.text for the probe function or "register"
> > > +	 * with platform_driver_probe.
> > > +	 */
> > > +	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
> > > +		pr_warning("oops-warning: probe function of platform driver %s"
> > > +			       " lives in .init.text\n", drv->driver.name);
> > > +#else
> > > +	/*
> > > +	 * without HOTPLUG probe functions can be discarded after the driver is
> > > +	 * loaded.
> > > +	 * There is a little chance for false positives, namely if the driver is
> > > +	 * registered after the .init sections are discarded.
> > > +	 */
> > > +	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
> > > +		pr_info("probably the probe function of platform driver %s can"
> > > +				" be moved to .init.text\n", drv->driver.name);
> > > +#endif
> > > +	return ret;
> > > +}
> > 
> > Um..., can't we extend modpost or such one for this? I think the static
> > analysis is better (assume the changing ->probe dynamically is really
> > rare).
> I like the idea and will look later into modpost if this can be done
> there.

That would be nice to do instead, as we already do checks like this
today, and might make more sense.

And could you do it for all probe functions, and not just the platform
devices?  Don't all busses have this same problem?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2010-01-26  8:59                                     ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
  2010-01-26 14:30                                       ` Greg KH
@ 2010-01-28 18:02                                       ` Greg KH
  2010-02-03  9:42                                         ` Uwe Kleine-König
  1 sibling, 1 reply; 197+ messages in thread
From: Greg KH @ 2010-01-28 18:02 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Greg KH, linux-kernel

On Tue, Jan 26, 2010 at 09:59:28AM +0100, Uwe Kleine-König wrote:
> Hello Greg,
> 
> On Fri, Jan 22, 2010 at 09:38:46AM -0800, Greg KH wrote:
> > On Fri, Jan 22, 2010 at 06:06:41PM +0100, Uwe Kleine-König wrote:
> > > Hello,
> > > 
> > > On Mon, Sep 07, 2009 at 04:19:41PM +0200, Uwe Kleine-König wrote:
> > > > Hi Greg,
> > > > 
> > > > On Sat, Jul 11, 2009 at 10:05:48AM -0700, Greg KH wrote:
> > > > > On Sat, Jul 11, 2009 at 12:00:14PM +0200, Uwe Kleine-König wrote:
> > > > > > Hi Greg,
> > > > > > 
> > > > > > > > Are you conviced and took the patch or did you give up to convince me?
> > > > > > > 
> > > > > > > Heh, no, sorry, it got burried in my queue.
> > > > > > > 
> > > > > > > > I still think the patch is correct and I'd like to have it applied.
> > > > > > > 
> > > > > > > Ok, let's test it out in the linux-next tree for a while to make sure it
> > > > > > > works properly.  Care to send me an updated version?
> > > > > > I updated to latest Linus' master.  It applies to linux-next from
> > > > > > Fri Jul 10 14:44:30 2009 +1000 as is.
> > > > > 
> > > > > Thanks, I'll apply it later today to my trees.
> > > > ping?!
> > > > 
> > > > > > Back some time I sent a series that fixes many of these bugs.  I will
> > > > > > update it later today and resend.
> > > > > 
> > > > > Thanks, that would be good to have, to keep the noise down for devices
> > > > > we already know about.
> > > ping?  I assume you don't have the original mails anymore, so should I
> > > resend?
> > 
> > Yes, sorry.
> I would really appreciate if you'd take the patches as it is quite some
> work to update and verify the patches are still needed as changing
> platform_driver_register to platform_driver_probe doesn't conflict with
> this series.
> 
> So can you please look into that before they are swapped out of your
> inbox the third(?) time?

I think the video ones can be all in one patch, that makes it easier for
me to track and apply.  Same goes for any others you can merge together.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-28  1:14                                           ` Greg KH
@ 2010-01-30 20:44                                             ` Uwe Kleine-König
  2010-01-30 20:46                                               ` [PATCH 1/7] modpost: members of *driver structs should not point to __init functions Uwe Kleine-König
                                                                 ` (8 more replies)
  0 siblings, 9 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-30 20:44 UTC (permalink / raw)
  To: Greg KH
  Cc: OGAWA Hirofumi, Greg KH, linux-kernel, Sam Ravnborg,
	Rusty Russell, Sean MacLennan, Andrew Morton

Hello,

On Wed, Jan 27, 2010 at 05:14:03PM -0800, Greg KH wrote:
> On Tue, Jan 26, 2010 at 09:47:41AM +0100, Uwe Kleine-König wrote:
> > On Mon, Jan 25, 2010 at 06:09:01AM +0900, OGAWA Hirofumi wrote:
> > > Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> > > > +int platform_driver_register(struct platform_driver *drv)
> > > > +{
> > > > +	int ret = __platform_driver_register(drv);
> > > > +
> > > > +#if defined(CONFIG_HOTPLUG)
> > > > +	/*
> > > > +	 * drivers that are registered by platform_driver_register
> > > > +	 * should not have their probe function in .init.text.  The
> > > > +	 * reason is that a probe can happen after .init.text is
> > > > +	 * discarded which then results in an oops.  The alternatives
> > > > +	 * are using .devinit.text for the probe function or "register"
> > > > +	 * with platform_driver_probe.
> > > > +	 */
> > > > +	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
> > > > +		pr_warning("oops-warning: probe function of platform driver %s"
> > > > +			       " lives in .init.text\n", drv->driver.name);
> > > > +#else
> > > > +	/*
> > > > +	 * without HOTPLUG probe functions can be discarded after the driver is
> > > > +	 * loaded.
> > > > +	 * There is a little chance for false positives, namely if the driver is
> > > > +	 * registered after the .init sections are discarded.
> > > > +	 */
> > > > +	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
> > > > +		pr_info("probably the probe function of platform driver %s can"
> > > > +				" be moved to .init.text\n", drv->driver.name);
> > > > +#endif
> > > > +	return ret;
> > > > +}
> > > 
> > > Um..., can't we extend modpost or such one for this? I think the static
> > > analysis is better (assume the changing ->probe dynamically is really
> > > rare).
> > I like the idea and will look later into modpost if this can be done
> > there.
> 
> That would be nice to do instead, as we already do checks like this
> today, and might make more sense.
> 
> And could you do it for all probe functions, and not just the platform
> devices?  Don't all busses have this same problem?
I think so, yes.  And I made some changes to modpost to detect those.
Tested on two defconfigs (ARCH=arm) it yields three hits, all valid.

I send the series as reply to this mail or you can get it via git, see
below.

The first six patches should not change behaviour, only do some cleanup
and preparation for the last patch.

The most interesting patch is "make symbol white list a per mismatch
type variable".  It allows a white list per section mismatch type and
so allows to say:

	*driver (in .data) might reference to .devinit.text but not
	.init.text

That's what the last patch does.

Best regards
Uwe

The following changes since commit 499a2673713c85734a54c37dd90b4b729de399c4:
  Linus Torvalds (1):
        Merge branch 'for-linus' of git://git.kernel.org/.../dtor/input

are available in the git repository at:

  git://git.pengutronix.de/git/ukl/linux-2.6.git modpost

Uwe Kleine-König (7):
      modpost: members of *driver structs should not point to __init functions
      modpost: define ALL_XXX{IN,EX}IT_SECTIONS
      modpost: give most mismatch constants a better name
      modpost: pass around const struct sectioncheck * instead of enum mismatch
      modpost: remove now unused NO_MISMATCH constant
      modpost: make symbol white list a per mismatch type variable
      modpost: don't allow *driver to reference .init.*

 scripts/mod/modpost.c |  152 ++++++++++++++++++++++++++++---------------------
 1 files changed, 88 insertions(+), 64 deletions(-)

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* [PATCH 1/7] modpost: members of *driver structs should not point to __init functions
  2010-01-30 20:44                                             ` Uwe Kleine-König
@ 2010-01-30 20:46                                               ` Uwe Kleine-König
  2010-01-30 20:46                                               ` [PATCH 2/7] modpost: define ALL_XYX{IN,EX}IT_SECTIONS Uwe Kleine-König
                                                                 ` (7 subsequent siblings)
  8 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-30 20:46 UTC (permalink / raw)
  To: Greg KH
  Cc: OGAWA Hirofumi, linux-kernel, Sam Ravnborg, Rusty Russell,
	Sean MacLennan, Andrew Morton

Either the functions referred to in a driver struct should live in
.devinit or the driver should be registered using platform_driver_probe
(or equivalent for different driver types) with ->probe being NULL.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/mod/modpost.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 2092361..713b62e 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -961,7 +961,7 @@ static int section_mismatch(const char *fromsec, const char *tosec)
  * Pattern 2:
  *   Many drivers utilise a *driver container with references to
  *   add, remove, probe functions etc.
- *   These functions may often be marked __init and we do not want to
+ *   These functions may often be marked __devinit and we do not want to
  *   warn here.
  *   the pattern is identified by:
  *   tosec   = init or exit section
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 2/7] modpost: define ALL_XYX{IN,EX}IT_SECTIONS
  2010-01-30 20:44                                             ` Uwe Kleine-König
  2010-01-30 20:46                                               ` [PATCH 1/7] modpost: members of *driver structs should not point to __init functions Uwe Kleine-König
@ 2010-01-30 20:46                                               ` Uwe Kleine-König
  2010-01-30 20:46                                               ` [PATCH 3/7] modpost: give most mismatch constants a better name Uwe Kleine-König
                                                                 ` (6 subsequent siblings)
  8 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-30 20:46 UTC (permalink / raw)
  To: Greg KH
  Cc: OGAWA Hirofumi, linux-kernel, Sam Ravnborg, Rusty Russell,
	Sean MacLennan, Andrew Morton

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
[resend to lkml as it blocked the original mail because of a triple-X in
the subject, fixed to read 'XYX']

 scripts/mod/modpost.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 713b62e..dbab53a 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -781,10 +781,13 @@ static void check_section(const char *modname, struct elf_info *elf,
 #define ALL_EXIT_TEXT_SECTIONS \
 	".exit.text$", ".devexit.text$", ".cpuexit.text$", ".memexit.text$"
 
-#define ALL_INIT_SECTIONS INIT_SECTIONS, DEV_INIT_SECTIONS, \
-	CPU_INIT_SECTIONS, MEM_INIT_SECTIONS
-#define ALL_EXIT_SECTIONS EXIT_SECTIONS, DEV_EXIT_SECTIONS, \
-	CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS
+#define ALL_XXXINIT_SECTIONS DEV_INIT_SECTIONS, CPU_INIT_SECTIONS, \
+	MEM_INIT_SECTIONS
+#define ALL_XXXEXIT_SECTIONS DEV_EXIT_SECTIONS, CPU_EXIT_SECTIONS, \
+	MEM_EXIT_SECTIONS
+
+#define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS
+#define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS
 
 #define DATA_SECTIONS ".data$", ".data.rel$"
 #define TEXT_SECTIONS ".text$"
@@ -876,7 +879,7 @@ const struct sectioncheck sectioncheck[] = {
 },
 /* Do not reference init code/data from devinit/cpuinit/meminit code/data */
 {
-	.fromsec = { DEV_INIT_SECTIONS, CPU_INIT_SECTIONS, MEM_INIT_SECTIONS, NULL },
+	.fromsec = { ALL_XXXINIT_SECTIONS, NULL },
 	.tosec   = { INIT_SECTIONS, NULL },
 	.mismatch = XXXINIT_TO_INIT,
 },
@@ -894,7 +897,7 @@ const struct sectioncheck sectioncheck[] = {
 },
 /* Do not reference exit code/data from devexit/cpuexit/memexit code/data */
 {
-	.fromsec = { DEV_EXIT_SECTIONS, CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS, NULL },
+	.fromsec = { ALL_XXXEXIT_SECTIONS, NULL },
 	.tosec   = { EXIT_SECTIONS, NULL },
 	.mismatch = XXXEXIT_TO_EXIT,
 },
-- 
1.6.6



^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 3/7] modpost: give most mismatch constants a better name
  2010-01-30 20:44                                             ` Uwe Kleine-König
  2010-01-30 20:46                                               ` [PATCH 1/7] modpost: members of *driver structs should not point to __init functions Uwe Kleine-König
  2010-01-30 20:46                                               ` [PATCH 2/7] modpost: define ALL_XYX{IN,EX}IT_SECTIONS Uwe Kleine-König
@ 2010-01-30 20:46                                               ` Uwe Kleine-König
  2010-01-30 20:46                                               ` [PATCH 4/7] modpost: pass around const struct sectioncheck * instead of enum mismatch Uwe Kleine-König
                                                                 ` (5 subsequent siblings)
  8 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-30 20:46 UTC (permalink / raw)
  To: Greg KH
  Cc: OGAWA Hirofumi, linux-kernel, Sam Ravnborg, Rusty Russell,
	Sean MacLennan, Andrew Morton

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/mod/modpost.c |   56 ++++++++++++++++++++++++------------------------
 1 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index dbab53a..598d54a 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -836,14 +836,14 @@ static const char *linker_symbols[] =
 
 enum mismatch {
 	NO_MISMATCH,
-	TEXT_TO_INIT,
-	DATA_TO_INIT,
-	TEXT_TO_EXIT,
-	DATA_TO_EXIT,
-	XXXINIT_TO_INIT,
-	XXXEXIT_TO_EXIT,
-	INIT_TO_EXIT,
-	EXIT_TO_INIT,
+	TEXT_TO_ANY_INIT,
+	DATA_TO_ANY_INIT,
+	TEXT_TO_ANY_EXIT,
+	DATA_TO_ANY_EXIT,
+	XXXINIT_TO_SOME_INIT,
+	XXXEXIT_TO_SOME_EXIT,
+	ANY_INIT_TO_ANY_EXIT,
+	ANY_EXIT_TO_ANY_INIT,
 	EXPORT_TO_INIT_EXIT,
 };
 
@@ -860,70 +860,70 @@ const struct sectioncheck sectioncheck[] = {
 {
 	.fromsec = { TEXT_SECTIONS, NULL },
 	.tosec   = { ALL_INIT_SECTIONS, NULL },
-	.mismatch = TEXT_TO_INIT,
+	.mismatch = TEXT_TO_ANY_INIT,
 },
 {
 	.fromsec = { DATA_SECTIONS, NULL },
 	.tosec   = { ALL_INIT_SECTIONS, NULL },
-	.mismatch = DATA_TO_INIT,
+	.mismatch = DATA_TO_ANY_INIT,
 },
 {
 	.fromsec = { TEXT_SECTIONS, NULL },
 	.tosec   = { ALL_EXIT_SECTIONS, NULL },
-	.mismatch = TEXT_TO_EXIT,
+	.mismatch = TEXT_TO_ANY_EXIT,
 },
 {
 	.fromsec = { DATA_SECTIONS, NULL },
 	.tosec   = { ALL_EXIT_SECTIONS, NULL },
-	.mismatch = DATA_TO_EXIT,
+	.mismatch = DATA_TO_ANY_EXIT,
 },
 /* Do not reference init code/data from devinit/cpuinit/meminit code/data */
 {
 	.fromsec = { ALL_XXXINIT_SECTIONS, NULL },
 	.tosec   = { INIT_SECTIONS, NULL },
-	.mismatch = XXXINIT_TO_INIT,
+	.mismatch = XXXINIT_TO_SOME_INIT,
 },
 /* Do not reference cpuinit code/data from meminit code/data */
 {
 	.fromsec = { MEM_INIT_SECTIONS, NULL },
 	.tosec   = { CPU_INIT_SECTIONS, NULL },
-	.mismatch = XXXINIT_TO_INIT,
+	.mismatch = XXXINIT_TO_SOME_INIT,
 },
 /* Do not reference meminit code/data from cpuinit code/data */
 {
 	.fromsec = { CPU_INIT_SECTIONS, NULL },
 	.tosec   = { MEM_INIT_SECTIONS, NULL },
-	.mismatch = XXXINIT_TO_INIT,
+	.mismatch = XXXINIT_TO_SOME_INIT,
 },
 /* Do not reference exit code/data from devexit/cpuexit/memexit code/data */
 {
 	.fromsec = { ALL_XXXEXIT_SECTIONS, NULL },
 	.tosec   = { EXIT_SECTIONS, NULL },
-	.mismatch = XXXEXIT_TO_EXIT,
+	.mismatch = XXXEXIT_TO_SOME_EXIT,
 },
 /* Do not reference cpuexit code/data from memexit code/data */
 {
 	.fromsec = { MEM_EXIT_SECTIONS, NULL },
 	.tosec   = { CPU_EXIT_SECTIONS, NULL },
-	.mismatch = XXXEXIT_TO_EXIT,
+	.mismatch = XXXEXIT_TO_SOME_EXIT,
 },
 /* Do not reference memexit code/data from cpuexit code/data */
 {
 	.fromsec = { CPU_EXIT_SECTIONS, NULL },
 	.tosec   = { MEM_EXIT_SECTIONS, NULL },
-	.mismatch = XXXEXIT_TO_EXIT,
+	.mismatch = XXXEXIT_TO_SOME_EXIT,
 },
 /* Do not use exit code/data from init code */
 {
 	.fromsec = { ALL_INIT_SECTIONS, NULL },
 	.tosec   = { ALL_EXIT_SECTIONS, NULL },
-	.mismatch = INIT_TO_EXIT,
+	.mismatch = ANY_INIT_TO_ANY_EXIT,
 },
 /* Do not use init code/data from exit code */
 {
 	.fromsec = { ALL_EXIT_SECTIONS, NULL },
 	.tosec   = { ALL_INIT_SECTIONS, NULL },
-	.mismatch = EXIT_TO_INIT,
+	.mismatch = ANY_EXIT_TO_ANY_INIT,
 },
 /* Do not export init/exit functions or data */
 {
@@ -1190,7 +1190,7 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch,
 	     tosym, to_p);
 
 	switch (mismatch) {
-	case TEXT_TO_INIT:
+	case TEXT_TO_ANY_INIT:
 		fprintf(stderr,
 		"The function %s%s() references\n"
 		"the %s %s%s%s.\n"
@@ -1200,7 +1200,7 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch,
 		to, sec2annotation(tosec), tosym, to_p,
 		fromsym, sec2annotation(tosec), tosym);
 		break;
-	case DATA_TO_INIT: {
+	case DATA_TO_ANY_INIT: {
 		const char **s = symbol_white_list;
 		fprintf(stderr,
 		"The variable %s references\n"
@@ -1214,14 +1214,14 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch,
 		fprintf(stderr, "\n");
 		break;
 	}
-	case TEXT_TO_EXIT:
+	case TEXT_TO_ANY_EXIT:
 		fprintf(stderr,
 		"The function %s() references a %s in an exit section.\n"
 		"Often the %s %s%s has valid usage outside the exit section\n"
 		"and the fix is to remove the %sannotation of %s.\n",
 		fromsym, to, to, tosym, to_p, sec2annotation(tosec), tosym);
 		break;
-	case DATA_TO_EXIT: {
+	case DATA_TO_ANY_EXIT: {
 		const char **s = symbol_white_list;
 		fprintf(stderr,
 		"The variable %s references\n"
@@ -1235,8 +1235,8 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch,
 		fprintf(stderr, "\n");
 		break;
 	}
-	case XXXINIT_TO_INIT:
-	case XXXEXIT_TO_EXIT:
+	case XXXINIT_TO_SOME_INIT:
+	case XXXEXIT_TO_SOME_EXIT:
 		fprintf(stderr,
 		"The %s %s%s%s references\n"
 		"a %s %s%s%s.\n"
@@ -1246,7 +1246,7 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch,
 		to, sec2annotation(tosec), tosym, to_p,
 		tosym, fromsym, tosym);
 		break;
-	case INIT_TO_EXIT:
+	case ANY_INIT_TO_ANY_EXIT:
 		fprintf(stderr,
 		"The %s %s%s%s references\n"
 		"a %s %s%s%s.\n"
@@ -1259,7 +1259,7 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch,
 		to, sec2annotation(tosec), tosym, to_p,
 		sec2annotation(tosec), tosym, to_p);
 		break;
-	case EXIT_TO_INIT:
+	case ANY_EXIT_TO_ANY_INIT:
 		fprintf(stderr,
 		"The %s %s%s%s references\n"
 		"a %s %s%s%s.\n"
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 4/7] modpost: pass around const struct sectioncheck * instead of enum mismatch
  2010-01-30 20:44                                             ` Uwe Kleine-König
                                                                 ` (2 preceding siblings ...)
  2010-01-30 20:46                                               ` [PATCH 3/7] modpost: give most mismatch constants a better name Uwe Kleine-König
@ 2010-01-30 20:46                                               ` Uwe Kleine-König
  2010-01-30 20:46                                               ` [PATCH 5/7] modpost: remove now unused NO_MISMATCH constant Uwe Kleine-König
                                                                 ` (4 subsequent siblings)
  8 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-30 20:46 UTC (permalink / raw)
  To: Greg KH
  Cc: OGAWA Hirofumi, linux-kernel, Sam Ravnborg, Rusty Russell,
	Sean MacLennan, Andrew Morton

This prepares having a per-check whitelist of symbol names.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/mod/modpost.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 598d54a..3f0380b 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -933,7 +933,8 @@ const struct sectioncheck sectioncheck[] = {
 }
 };
 
-static int section_mismatch(const char *fromsec, const char *tosec)
+static const struct sectioncheck *section_mismatch(
+		const char *fromsec, const char *tosec)
 {
 	int i;
 	int elems = sizeof(sectioncheck) / sizeof(struct sectioncheck);
@@ -942,10 +943,10 @@ static int section_mismatch(const char *fromsec, const char *tosec)
 	for (i = 0; i < elems; i++) {
 		if (match(fromsec, check->fromsec) &&
 		    match(tosec, check->tosec))
-			return check->mismatch;
+			return check;
 		check++;
 	}
-	return NO_MISMATCH;
+	return NULL;
 }
 
 /**
@@ -1158,7 +1159,8 @@ static int is_function(Elf_Sym *sym)
  * Try to find symbols near it so user can find it.
  * Check whitelist before warning - it may be a false positive.
  */
-static void report_sec_mismatch(const char *modname, enum mismatch mismatch,
+static void report_sec_mismatch(const char *modname,
+				const struct sectioncheck *mismatch,
                                 const char *fromsec,
                                 unsigned long long fromaddr,
                                 const char *fromsym,
@@ -1189,7 +1191,7 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch,
 	     modname, fromsec, fromaddr, from, fromsym, from_p, to, tosec,
 	     tosym, to_p);
 
-	switch (mismatch) {
+	switch (mismatch->mismatch) {
 	case TEXT_TO_ANY_INIT:
 		fprintf(stderr,
 		"The function %s%s() references\n"
@@ -1289,11 +1291,11 @@ static void check_section_mismatch(const char *modname, struct elf_info *elf,
                                    Elf_Rela *r, Elf_Sym *sym, const char *fromsec)
 {
 	const char *tosec;
-	enum mismatch mismatch;
+	const struct sectioncheck *mismatch;
 
 	tosec = sec_name(elf, sym->st_shndx);
 	mismatch = section_mismatch(fromsec, tosec);
-	if (mismatch != NO_MISMATCH) {
+	if (mismatch) {
 		Elf_Sym *to;
 		Elf_Sym *from;
 		const char *tosym;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 5/7] modpost: remove now unused NO_MISMATCH constant
  2010-01-30 20:44                                             ` Uwe Kleine-König
                                                                 ` (3 preceding siblings ...)
  2010-01-30 20:46                                               ` [PATCH 4/7] modpost: pass around const struct sectioncheck * instead of enum mismatch Uwe Kleine-König
@ 2010-01-30 20:46                                               ` Uwe Kleine-König
  2010-01-30 20:46                                               ` [PATCH 6/7] modpost: make symbol white list a per mismatch type variable Uwe Kleine-König
                                                                 ` (3 subsequent siblings)
  8 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-30 20:46 UTC (permalink / raw)
  To: Greg KH
  Cc: OGAWA Hirofumi, linux-kernel, Sam Ravnborg, Rusty Russell,
	Sean MacLennan, Andrew Morton

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/mod/modpost.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 3f0380b..a94bd10 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -835,7 +835,6 @@ static const char *linker_symbols[] =
 	{ "__init_begin", "_sinittext", "_einittext", NULL };
 
 enum mismatch {
-	NO_MISMATCH,
 	TEXT_TO_ANY_INIT,
 	DATA_TO_ANY_INIT,
 	TEXT_TO_ANY_EXIT,
@@ -1280,8 +1279,6 @@ static void report_sec_mismatch(const char *modname,
 		"Fix this by removing the %sannotation of %s "
 		"or drop the export.\n",
 		tosym, sec2annotation(tosec), sec2annotation(tosec), tosym);
-	case NO_MISMATCH:
-		/* To get warnings on missing members */
 		break;
 	}
 	fprintf(stderr, "\n");
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 6/7] modpost: make symbol white list a per mismatch type variable
  2010-01-30 20:44                                             ` Uwe Kleine-König
                                                                 ` (4 preceding siblings ...)
  2010-01-30 20:46                                               ` [PATCH 5/7] modpost: remove now unused NO_MISMATCH constant Uwe Kleine-König
@ 2010-01-30 20:46                                               ` Uwe Kleine-König
  2010-01-30 20:46                                               ` [PATCH 7/7] modpost: don't allow *driver to reference .init.* Uwe Kleine-König
                                                                 ` (2 subsequent siblings)
  8 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-30 20:46 UTC (permalink / raw)
  To: Greg KH
  Cc: OGAWA Hirofumi, linux-kernel, Sam Ravnborg, Rusty Russell,
	Sean MacLennan, Andrew Morton

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/mod/modpost.c |   49 +++++++++++++++++++++++++++++++------------------
 1 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index a94bd10..5dbe4db 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -817,18 +817,15 @@ static const char *data_sections[] = { DATA_SECTIONS, NULL };
 
 
 /* symbols in .data that may refer to init/exit sections */
-static const char *symbol_white_list[] =
-{
-	"*driver",
-	"*_template", /* scsi uses *_template a lot */
-	"*_timer",    /* arm uses ops structures named _timer a lot */
-	"*_sht",      /* scsi also used *_sht to some extent */
-	"*_ops",
-	"*_probe",
-	"*_probe_one",
-	"*_console",
-	NULL
-};
+#define DEFAULT_SYMBOL_WHITE_LIST					\
+	"*driver",							\
+	"*_template", /* scsi uses *_template a lot */			\
+	"*_timer",    /* arm uses ops structures named _timer a lot */	\
+	"*_sht",      /* scsi also used *_sht to some extent */		\
+	"*_ops",							\
+	"*_probe",							\
+	"*_probe_one",							\
+	"*_console"
 
 static const char *head_sections[] = { ".head.text*", NULL };
 static const char *linker_symbols[] =
@@ -850,6 +847,7 @@ struct sectioncheck {
 	const char *fromsec[20];
 	const char *tosec[20];
 	enum mismatch mismatch;
+	const char *symbol_white_list[20];
 };
 
 const struct sectioncheck sectioncheck[] = {
@@ -860,75 +858,88 @@ const struct sectioncheck sectioncheck[] = {
 	.fromsec = { TEXT_SECTIONS, NULL },
 	.tosec   = { ALL_INIT_SECTIONS, NULL },
 	.mismatch = TEXT_TO_ANY_INIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 {
 	.fromsec = { DATA_SECTIONS, NULL },
 	.tosec   = { ALL_INIT_SECTIONS, NULL },
 	.mismatch = DATA_TO_ANY_INIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 {
 	.fromsec = { TEXT_SECTIONS, NULL },
 	.tosec   = { ALL_EXIT_SECTIONS, NULL },
 	.mismatch = TEXT_TO_ANY_EXIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 {
 	.fromsec = { DATA_SECTIONS, NULL },
 	.tosec   = { ALL_EXIT_SECTIONS, NULL },
 	.mismatch = DATA_TO_ANY_EXIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 /* Do not reference init code/data from devinit/cpuinit/meminit code/data */
 {
 	.fromsec = { ALL_XXXINIT_SECTIONS, NULL },
 	.tosec   = { INIT_SECTIONS, NULL },
 	.mismatch = XXXINIT_TO_SOME_INIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 /* Do not reference cpuinit code/data from meminit code/data */
 {
 	.fromsec = { MEM_INIT_SECTIONS, NULL },
 	.tosec   = { CPU_INIT_SECTIONS, NULL },
 	.mismatch = XXXINIT_TO_SOME_INIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 /* Do not reference meminit code/data from cpuinit code/data */
 {
 	.fromsec = { CPU_INIT_SECTIONS, NULL },
 	.tosec   = { MEM_INIT_SECTIONS, NULL },
 	.mismatch = XXXINIT_TO_SOME_INIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 /* Do not reference exit code/data from devexit/cpuexit/memexit code/data */
 {
 	.fromsec = { ALL_XXXEXIT_SECTIONS, NULL },
 	.tosec   = { EXIT_SECTIONS, NULL },
 	.mismatch = XXXEXIT_TO_SOME_EXIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 /* Do not reference cpuexit code/data from memexit code/data */
 {
 	.fromsec = { MEM_EXIT_SECTIONS, NULL },
 	.tosec   = { CPU_EXIT_SECTIONS, NULL },
 	.mismatch = XXXEXIT_TO_SOME_EXIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 /* Do not reference memexit code/data from cpuexit code/data */
 {
 	.fromsec = { CPU_EXIT_SECTIONS, NULL },
 	.tosec   = { MEM_EXIT_SECTIONS, NULL },
 	.mismatch = XXXEXIT_TO_SOME_EXIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 /* Do not use exit code/data from init code */
 {
 	.fromsec = { ALL_INIT_SECTIONS, NULL },
 	.tosec   = { ALL_EXIT_SECTIONS, NULL },
 	.mismatch = ANY_INIT_TO_ANY_EXIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 /* Do not use init code/data from exit code */
 {
 	.fromsec = { ALL_EXIT_SECTIONS, NULL },
 	.tosec   = { ALL_INIT_SECTIONS, NULL },
 	.mismatch = ANY_EXIT_TO_ANY_INIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 /* Do not export init/exit functions or data */
 {
 	.fromsec = { "__ksymtab*", NULL },
 	.tosec   = { INIT_SECTIONS, EXIT_SECTIONS, NULL },
-	.mismatch = EXPORT_TO_INIT_EXIT
+	.mismatch = EXPORT_TO_INIT_EXIT,
+	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 }
 };
 
@@ -985,7 +996,8 @@ static const struct sectioncheck *section_mismatch(
  *   refsymname = __init_begin, _sinittext, _einittext
  *
  **/
-static int secref_whitelist(const char *fromsec, const char *fromsym,
+static int secref_whitelist(const struct sectioncheck *mismatch,
+			    const char *fromsec, const char *fromsym,
 			    const char *tosec, const char *tosym)
 {
 	/* Check for pattern 1 */
@@ -997,7 +1009,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym,
 	/* Check for pattern 2 */
 	if (match(tosec, init_exit_sections) &&
 	    match(fromsec, data_sections) &&
-	    match(fromsym, symbol_white_list))
+	    match(fromsym, mismatch->symbol_white_list))
 		return 0;
 
 	/* Check for pattern 3 */
@@ -1202,7 +1214,7 @@ static void report_sec_mismatch(const char *modname,
 		fromsym, sec2annotation(tosec), tosym);
 		break;
 	case DATA_TO_ANY_INIT: {
-		const char **s = symbol_white_list;
+		const char *const *s = mismatch->symbol_white_list;
 		fprintf(stderr,
 		"The variable %s references\n"
 		"the %s %s%s%s\n"
@@ -1223,7 +1235,7 @@ static void report_sec_mismatch(const char *modname,
 		fromsym, to, to, tosym, to_p, sec2annotation(tosec), tosym);
 		break;
 	case DATA_TO_ANY_EXIT: {
-		const char **s = symbol_white_list;
+		const char *const *s = mismatch->symbol_white_list;
 		fprintf(stderr,
 		"The variable %s references\n"
 		"the %s %s%s%s\n"
@@ -1304,7 +1316,8 @@ static void check_section_mismatch(const char *modname, struct elf_info *elf,
 		tosym = sym_name(elf, to);
 
 		/* check whitelist - we may ignore it */
-		if (secref_whitelist(fromsec, fromsym, tosec, tosym)) {
+		if (secref_whitelist(mismatch,
+					fromsec, fromsym, tosec, tosym)) {
 			report_sec_mismatch(modname, mismatch,
 			   fromsec, r->r_offset, fromsym,
 			   is_function(from), tosec, tosym,
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 7/7] modpost: don't allow *driver to reference .init.*
  2010-01-30 20:44                                             ` Uwe Kleine-König
                                                                 ` (5 preceding siblings ...)
  2010-01-30 20:46                                               ` [PATCH 6/7] modpost: make symbol white list a per mismatch type variable Uwe Kleine-König
@ 2010-01-30 20:46                                               ` Uwe Kleine-König
  2010-01-31 16:02                                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Sam Ravnborg
  2010-02-01 14:57                                                 ` Uwe Kleine-König
  8 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-30 20:46 UTC (permalink / raw)
  To: Greg KH
  Cc: OGAWA Hirofumi, linux-kernel, Sam Ravnborg, Rusty Russell,
	Sean MacLennan, Andrew Morton

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/mod/modpost.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 5dbe4db..3318692 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -862,11 +862,20 @@ const struct sectioncheck sectioncheck[] = {
 },
 {
 	.fromsec = { DATA_SECTIONS, NULL },
-	.tosec   = { ALL_INIT_SECTIONS, NULL },
+	.tosec   = { ALL_XXXINIT_SECTIONS, NULL },
 	.mismatch = DATA_TO_ANY_INIT,
 	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
 {
+	.fromsec = { DATA_SECTIONS, NULL },
+	.tosec   = { INIT_SECTIONS, NULL },
+	.mismatch = DATA_TO_ANY_INIT,
+	.symbol_white_list = {
+		"*_template", "*_timer", "*_sht", "*_ops",
+		"*_probe", "*_probe_one", "*_console", NULL
+	},
+},
+{
 	.fromsec = { TEXT_SECTIONS, NULL },
 	.tosec   = { ALL_EXIT_SECTIONS, NULL },
 	.mismatch = TEXT_TO_ANY_EXIT,
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-30 20:44                                             ` Uwe Kleine-König
                                                                 ` (6 preceding siblings ...)
  2010-01-30 20:46                                               ` [PATCH 7/7] modpost: don't allow *driver to reference .init.* Uwe Kleine-König
@ 2010-01-31 16:02                                               ` Sam Ravnborg
  2010-01-31 20:13                                                 ` Uwe Kleine-König
  2010-02-01 14:57                                                 ` Uwe Kleine-König
  8 siblings, 1 reply; 197+ messages in thread
From: Sam Ravnborg @ 2010-01-31 16:02 UTC (permalink / raw)
  To: Uwe Kleine-K?nig, Michal Marek
  Cc: Greg KH, OGAWA Hirofumi, Greg KH, linux-kernel, Rusty Russell,
	Sean MacLennan, Andrew Morton

On Sat, Jan 30, 2010 at 09:44:25PM +0100, Uwe Kleine-K?nig wrote:
> Hello,
> 
> On Wed, Jan 27, 2010 at 05:14:03PM -0800, Greg KH wrote:
> > On Tue, Jan 26, 2010 at 09:47:41AM +0100, Uwe Kleine-König wrote:
> > > On Mon, Jan 25, 2010 at 06:09:01AM +0900, OGAWA Hirofumi wrote:
> > > > Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> > > > > +int platform_driver_register(struct platform_driver *drv)
> > > > > +{
> > > > > +	int ret = __platform_driver_register(drv);
> > > > > +
> > > > > +#if defined(CONFIG_HOTPLUG)
> > > > > +	/*
> > > > > +	 * drivers that are registered by platform_driver_register
> > > > > +	 * should not have their probe function in .init.text.  The
> > > > > +	 * reason is that a probe can happen after .init.text is
> > > > > +	 * discarded which then results in an oops.  The alternatives
> > > > > +	 * are using .devinit.text for the probe function or "register"
> > > > > +	 * with platform_driver_probe.
> > > > > +	 */
> > > > > +	if (drv->probe && kernel_init_text_address((unsigned long)drv->probe))
> > > > > +		pr_warning("oops-warning: probe function of platform driver %s"
> > > > > +			       " lives in .init.text\n", drv->driver.name);
> > > > > +#else
> > > > > +	/*
> > > > > +	 * without HOTPLUG probe functions can be discarded after the driver is
> > > > > +	 * loaded.
> > > > > +	 * There is a little chance for false positives, namely if the driver is
> > > > > +	 * registered after the .init sections are discarded.
> > > > > +	 */
> > > > > +	if (drv->probe && !kernel_init_text_address((unsigned long)drv->probe))
> > > > > +		pr_info("probably the probe function of platform driver %s can"
> > > > > +				" be moved to .init.text\n", drv->driver.name);
> > > > > +#endif
> > > > > +	return ret;
> > > > > +}
> > > > 
> > > > Um..., can't we extend modpost or such one for this? I think the static
> > > > analysis is better (assume the changing ->probe dynamically is really
> > > > rare).
> > > I like the idea and will look later into modpost if this can be done
> > > there.
> > 
> > That would be nice to do instead, as we already do checks like this
> > today, and might make more sense.
> > 
> > And could you do it for all probe functions, and not just the platform
> > devices?  Don't all busses have this same problem?
> I think so, yes.  And I made some changes to modpost to detect those.
> Tested on two defconfigs (ARCH=arm) it yields three hits, all valid.
> 
> I send the series as reply to this mail or you can get it via git, see
> below.
> 
> The first six patches should not change behaviour, only do some cleanup
> and preparation for the last patch.
> 
> The most interesting patch is "make symbol white list a per mismatch
> type variable".  It allows a white list per section mismatch type and
> so allows to say:
> 
> 	*driver (in .data) might reference to .devinit.text but not
> 	.init.text
> 
> That's what the last patch does.

Michael is handling kbuild stuff now and that may include modpost stuff.
So added Michael - then you guys can decide way forward.

The modpost patches looks OK at a quick view.
You can consider adding:

Acked-by: Sam Ravnborg <sam@ravnborg.org>

	Sam

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-31 16:02                                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Sam Ravnborg
@ 2010-01-31 20:13                                                 ` Uwe Kleine-König
  2010-02-02 15:25                                                   ` Michal Marek
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2010-01-31 20:13 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Michal Marek, Greg KH, OGAWA Hirofumi, Greg KH, linux-kernel,
	Rusty Russell, Sean MacLennan, Andrew Morton

Hello,

> Michael is handling kbuild stuff now and that may include modpost stuff.
> So added Michael - then you guys can decide way forward.
Then the F: patterns for kbuild in MAINTAINERS should be extended.
 
> The modpost patches looks OK at a quick view.
> You can consider adding:
> 
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
Thanks,
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* [PATCH] i2c/imx: don't add probe function to the driver struct
@ 2010-02-01 14:57                                                 ` Uwe Kleine-König
  0 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-01 14:57 UTC (permalink / raw)
  To: linux-i2c
  Cc: Ben Dooks, Wolfram Sang, Richard Zhao, Darius Augulis,
	Sascha Hauer, linux-kernel, Greg KH, OGAWA Hirofumi, Greg KH,
	Sam Ravnborg, Rusty Russell, Sean MacLennan, Andrew Morton

Having a pointer to the probe function is unnecessary when using
platform_driver_probe and yields a section mismatch warning after
removing the white list entry "*driver" for
{ .data$, .data.rel$ } -> { .init.* } mismatches in modpost.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

this is a new section mismatch found by modpost after my patches.

Best regards
Uwe

 drivers/i2c/busses/i2c-imx.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 75bf820..32375bd 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -627,7 +627,6 @@ static int __exit i2c_imx_remove(struct platform_device *pdev)
 }
 
 static struct platform_driver i2c_imx_driver = {
-	.probe		= i2c_imx_probe,
 	.remove		= __exit_p(i2c_imx_remove),
 	.driver	= {
 		.name	= DRIVER_NAME,
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH] i2c/imx: don't add probe function to the driver struct
@ 2010-02-01 14:57                                                 ` Uwe Kleine-König
  0 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-01 14:57 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: Ben Dooks, Wolfram Sang, Richard Zhao, Darius Augulis,
	Sascha Hauer, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Greg KH,
	OGAWA Hirofumi, Greg KH, Sam Ravnborg, Rusty Russell,
	Sean MacLennan, Andrew Morton

Having a pointer to the probe function is unnecessary when using
platform_driver_probe and yields a section mismatch warning after
removing the white list entry "*driver" for
{ .data$, .data.rel$ } -> { .init.* } mismatches in modpost.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Hello,

this is a new section mismatch found by modpost after my patches.

Best regards
Uwe

 drivers/i2c/busses/i2c-imx.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 75bf820..32375bd 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -627,7 +627,6 @@ static int __exit i2c_imx_remove(struct platform_device *pdev)
 }
 
 static struct platform_driver i2c_imx_driver = {
-	.probe		= i2c_imx_probe,
 	.remove		= __exit_p(i2c_imx_remove),
 	.driver	= {
 		.name	= DRIVER_NAME,
-- 
1.6.6

^ permalink raw reply related	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register: warn if probe is in .init.text
  2010-01-31 20:13                                                 ` Uwe Kleine-König
@ 2010-02-02 15:25                                                   ` Michal Marek
  0 siblings, 0 replies; 197+ messages in thread
From: Michal Marek @ 2010-02-02 15:25 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Sam Ravnborg, Greg KH, OGAWA Hirofumi, Greg KH, linux-kernel,
	Rusty Russell, Sean MacLennan, Andrew Morton

On 31.1.2010 21:13, Uwe Kleine-König wrote:
> Hello,
> 
>> Michael is handling kbuild stuff now and that may include modpost stuff.
>> So added Michael - then you guys can decide way forward.
> Then the F: patterns for kbuild in MAINTAINERS should be extended.

Well, modpost is kind of grey zone between module support (Rusty, whom
you already included) and kbuild (me, who added a subject filter for
"modpost" and is happy). This series is more kbuild related (it does not
affect the module loader) and it looks ok to me, so I'll pull it.

>  
>> The modpost patches looks OK at a quick view.
>> You can consider adding:
>>
>> Acked-by: Sam Ravnborg <sam@ravnborg.org>

Thanks, I added your ack to the merge commit.

Michal

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2010-01-28 18:02                                       ` Greg KH
@ 2010-02-03  9:42                                         ` Uwe Kleine-König
  2010-02-03 15:08                                           ` Greg KH
  0 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-03  9:42 UTC (permalink / raw)
  To: Greg KH; +Cc: Greg KH, linux-kernel

Hello,

> > So can you please look into that before they are swapped out of your
> > inbox the third(?) time?
> 
> I think the video ones can be all in one patch, that makes it easier for
> me to track and apply.  Same goes for any others you can merge together.
So I group by drivers/* and arch/*?

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH] platform_driver_register:  warn if probe is in .init.text
  2010-02-03  9:42                                         ` Uwe Kleine-König
@ 2010-02-03 15:08                                           ` Greg KH
  2010-02-04 19:56                                             ` [PATCH 1/9] platform-drivers: move probe to .devinit.text in arch/arm Uwe Kleine-König
                                                               ` (7 more replies)
  0 siblings, 8 replies; 197+ messages in thread
From: Greg KH @ 2010-02-03 15:08 UTC (permalink / raw)
  To: Uwe Kleine-K?nig; +Cc: Greg KH, linux-kernel

On Wed, Feb 03, 2010 at 10:42:26AM +0100, Uwe Kleine-K?nig wrote:
> Hello,
> 
> > > So can you please look into that before they are swapped out of your
> > > inbox the third(?) time?
> > 
> > I think the video ones can be all in one patch, that makes it easier for
> > me to track and apply.  Same goes for any others you can merge together.
> So I group by drivers/* and arch/*?

Sure, that would make it easier, right?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* [PATCH 1/9] platform-drivers: move probe to .devinit.text in arch/arm
  2010-02-03 15:08                                           ` Greg KH
@ 2010-02-04 19:56                                             ` Uwe Kleine-König
  2010-02-04 20:56                                               ` Dmitry Eremin-Solenikov
  2010-02-04 21:20                                               ` Arnaud Patard
  2010-02-04 19:56                                             ` [PATCH 2/9] platform-drivers: move probe to .devinit.text in drivers/scsi Uwe Kleine-König
                                                               ` (6 subsequent siblings)
  7 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-04 19:56 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Andrew Morton, Arnaud Patard, Ben Dooks, Dmitry Baryshkov,
	Eric Miao, Kristoffer Ericson, Liam Girdwood, Paul Sokolovsky,
	Richard Purdie, Russell King

A pointer to a probe callback is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Eric Miao <eric.miao@marvell.com>
Cc: Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
Cc: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
Cc: Paul Sokolovsky <pmiscml@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/mach-pxa/corgi_ssp.c           |    2 +-
 arch/arm/mach-pxa/sharpsl_pm.c          |    2 +-
 arch/arm/mach-s3c2410/h1940-bluetooth.c |    2 +-
 arch/arm/mach-sa1100/jornada720_ssp.c   |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index a5ee707..1d9bc11 100644
--- a/arch/arm/mach-pxa/corgi_ssp.c
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -204,7 +204,7 @@ void __init corgi_ssp_set_machinfo(struct corgissp_machinfo *machinfo)
 	ssp_machinfo = machinfo;
 }
 
-static int __init corgi_ssp_probe(struct platform_device *dev)
+static int __devinit corgi_ssp_probe(struct platform_device *dev)
 {
 	int ret;
 
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index 67229a1..463d874 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -900,7 +900,7 @@ static struct platform_suspend_ops sharpsl_pm_ops = {
 };
 #endif
 
-static int __init sharpsl_pm_probe(struct platform_device *pdev)
+static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
 {
 	int ret;
 
diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c
index b7d1f8d..a3f3c7b 100644
--- a/arch/arm/mach-s3c2410/h1940-bluetooth.c
+++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c
@@ -56,7 +56,7 @@ static const struct rfkill_ops h1940bt_rfkill_ops = {
 	.set_block = h1940bt_set_block,
 };
 
-static int __init h1940bt_probe(struct platform_device *pdev)
+static int __devinit h1940bt_probe(struct platform_device *pdev)
 {
 	struct rfkill *rfk;
 	int ret = 0;
diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c
index 506a5e5..9b6dee5 100644
--- a/arch/arm/mach-sa1100/jornada720_ssp.c
+++ b/arch/arm/mach-sa1100/jornada720_ssp.c
@@ -130,7 +130,7 @@ void jornada_ssp_end(void)
 };
 EXPORT_SYMBOL(jornada_ssp_end);
 
-static int __init jornada_ssp_probe(struct platform_device *dev)
+static int __devinit jornada_ssp_probe(struct platform_device *dev)
 {
 	int ret;
 
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 2/9] platform-drivers: move probe to .devinit.text in drivers/scsi
  2010-02-03 15:08                                           ` Greg KH
  2010-02-04 19:56                                             ` [PATCH 1/9] platform-drivers: move probe to .devinit.text in arch/arm Uwe Kleine-König
@ 2010-02-04 19:56                                             ` Uwe Kleine-König
  2010-02-04 20:25                                               ` Ralf Baechle
  2010-02-04 19:56                                             ` [PATCH 4/9] x86: move hp-wmi's probe function to .devinit.text Uwe Kleine-König
                                                               ` (5 subsequent siblings)
  7 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-04 19:56 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Andrew Morton, David Brownell, Dmitri Vorobiev,
	Henrik Kretzschmar, James Bottomley, Kay Sievers, peter fuerst,
	Ralf Baechle, Thomas Bogendoerfer

A pointer to a probe callback is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Cc: Henrik Kretzschmar <henne@nachtwindheim.de>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: peter fuerst <post@pfrst.de>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
 drivers/scsi/sgiwd93.c    |    2 +-
 drivers/scsi/sni_53c710.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index 0807b26..fef0e3c 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -226,7 +226,7 @@ static struct scsi_host_template sgiwd93_template = {
 	.use_clustering		= DISABLE_CLUSTERING,
 };
 
-static int __init sgiwd93_probe(struct platform_device *pdev)
+static int __devinit sgiwd93_probe(struct platform_device *pdev)
 {
 	struct sgiwd93_platform_data *pd = pdev->dev.platform_data;
 	unsigned char *wdregs = pd->wdregs;
diff --git a/drivers/scsi/sni_53c710.c b/drivers/scsi/sni_53c710.c
index 37b3359..56cf0bb 100644
--- a/drivers/scsi/sni_53c710.c
+++ b/drivers/scsi/sni_53c710.c
@@ -64,7 +64,7 @@ static struct scsi_host_template snirm710_template = {
 	.module		= THIS_MODULE,
 };
 
-static int __init snirm710_probe(struct platform_device *dev)
+static int __devinit snirm710_probe(struct platform_device *dev)
 {
 	unsigned long base;
 	struct NCR_700_Host_Parameters *hostdata;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 4/9] x86: move hp-wmi's probe function to .devinit.text
  2010-02-03 15:08                                           ` Greg KH
  2010-02-04 19:56                                             ` [PATCH 1/9] platform-drivers: move probe to .devinit.text in arch/arm Uwe Kleine-König
  2010-02-04 19:56                                             ` [PATCH 2/9] platform-drivers: move probe to .devinit.text in drivers/scsi Uwe Kleine-König
@ 2010-02-04 19:56                                             ` Uwe Kleine-König
  2010-02-04 20:05                                               ` Matthew Garrett
  2010-02-04 19:56                                             ` [PATCH 5/9] i2c: move i2c_omap's " Uwe Kleine-König
                                                               ` (4 subsequent siblings)
  7 siblings, 1 reply; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-04 19:56 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Frans Pop, Larry Finger, Len Brown, Helge Deller,
	Matthew Garrett, Andrew Morton

A pointer to hp_wmi_bios_setup is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Frans Pop <elendil@planet.nl>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Len Brown <lenb@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/platform/x86/hp-wmi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index ad4c414..5c7259a 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -57,7 +57,7 @@ enum hp_wmi_radio {
 	HPWMI_WWAN = 2,
 };
 
-static int __init hp_wmi_bios_setup(struct platform_device *device);
+static int __devinit hp_wmi_bios_setup(struct platform_device *device);
 static int __exit hp_wmi_bios_remove(struct platform_device *device);
 static int hp_wmi_resume_handler(struct device *device);
 
@@ -446,7 +446,7 @@ static void cleanup_sysfs(struct platform_device *device)
 	device_remove_file(&device->dev, &dev_attr_tablet);
 }
 
-static int __init hp_wmi_bios_setup(struct platform_device *device)
+static int __devinit hp_wmi_bios_setup(struct platform_device *device)
 {
 	int err;
 	int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0);
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 5/9] i2c: move i2c_omap's probe function to .devinit.text
  2010-02-03 15:08                                           ` Greg KH
                                                               ` (2 preceding siblings ...)
  2010-02-04 19:56                                             ` [PATCH 4/9] x86: move hp-wmi's probe function to .devinit.text Uwe Kleine-König
@ 2010-02-04 19:56                                             ` Uwe Kleine-König
  2010-02-04 19:56                                             ` [PATCH 6/9] w1: move omap_hdq's " Uwe Kleine-König
                                                               ` (3 subsequent siblings)
  7 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-04 19:56 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Kalle Jokiniemi, Tony Lindgren, Paul Walmsley, Richard Woodruff,
	chandra shekhar, Jason P Marini, Syed Mohammed Khasim,
	Jarkko Nikula, Juha Yrjola, Andrew Morton

A pointer to omap_i2c_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Kalle Jokiniemi <ext-kalle.jokiniemi@nokia.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
Cc: chandra shekhar <x0044955@ti.com>
Cc: Jason P Marini <jason.marini@gmail.com>
Cc: Syed Mohammed Khasim  <x0khasim@ti.com>
Cc: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: Juha Yrjola <juha.yrjola@solidboot.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/i2c/busses/i2c-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 0037e31..bd86a85 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -849,7 +849,7 @@ static const struct i2c_algorithm omap_i2c_algo = {
 	.functionality	= omap_i2c_func,
 };
 
-static int __init
+static int __devinit
 omap_i2c_probe(struct platform_device *pdev)
 {
 	struct omap_i2c_dev	*dev;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 6/9] w1: move omap_hdq's probe function to .devinit.text
  2010-02-03 15:08                                           ` Greg KH
                                                               ` (3 preceding siblings ...)
  2010-02-04 19:56                                             ` [PATCH 5/9] i2c: move i2c_omap's " Uwe Kleine-König
@ 2010-02-04 19:56                                             ` Uwe Kleine-König
  2010-02-04 19:56                                             ` [PATCH 7/9] media: move omap24xxcam's " Uwe Kleine-König
                                                               ` (2 subsequent siblings)
  7 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-04 19:56 UTC (permalink / raw)
  To: Greg KH, linux-kernel
  Cc: Stanley.Miao, Andrew Morton, Madhusudhan Chikkature, Felipe Balbi

A pointer to omap_hdq_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Stanley.Miao <stanley.miao@windriver.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
---
 drivers/w1/masters/omap_hdq.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 0d92969..22977d3 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -72,7 +72,7 @@ struct hdq_data {
 	int			init_trans;
 };
 
-static int __init omap_hdq_probe(struct platform_device *pdev);
+static int __devinit omap_hdq_probe(struct platform_device *pdev);
 static int omap_hdq_remove(struct platform_device *pdev);
 
 static struct platform_driver omap_hdq_driver = {
@@ -558,7 +558,7 @@ static void omap_w1_write_byte(void *_hdq, u8 byte)
 	return;
 }
 
-static int __init omap_hdq_probe(struct platform_device *pdev)
+static int __devinit omap_hdq_probe(struct platform_device *pdev)
 {
 	struct hdq_data *hdq_data;
 	struct resource *res;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 7/9] media: move omap24xxcam's probe function to .devinit.text
  2010-02-03 15:08                                           ` Greg KH
                                                               ` (4 preceding siblings ...)
  2010-02-04 19:56                                             ` [PATCH 6/9] w1: move omap_hdq's " Uwe Kleine-König
@ 2010-02-04 19:56                                             ` Uwe Kleine-König
  2010-02-04 19:56                                             ` [PATCH 8/9] auxdisplay: move cfag12864bfb's " Uwe Kleine-König
  2010-02-04 19:56                                             ` [PATCH 9/9] net: move am79c961's " Uwe Kleine-König
  7 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-04 19:56 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Hans Verkuil, Mauro Carvalho Chehab, Andrew Morton

A pointer to omap24xxcam_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Acked-by: Trilok Soni <soni.trilok@gmail.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/media/video/omap24xxcam.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c
index 7400eac..142c327 100644
--- a/drivers/media/video/omap24xxcam.c
+++ b/drivers/media/video/omap24xxcam.c
@@ -1735,7 +1735,7 @@ static struct v4l2_int_device omap24xxcam = {
  *
  */
 
-static int __init omap24xxcam_probe(struct platform_device *pdev)
+static int __devinit omap24xxcam_probe(struct platform_device *pdev)
 {
 	struct omap24xxcam_device *cam;
 	struct resource *mem;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 8/9] auxdisplay: move cfag12864bfb's probe function to .devinit.text
  2010-02-03 15:08                                           ` Greg KH
                                                               ` (5 preceding siblings ...)
  2010-02-04 19:56                                             ` [PATCH 7/9] media: move omap24xxcam's " Uwe Kleine-König
@ 2010-02-04 19:56                                             ` Uwe Kleine-König
  2010-02-04 19:56                                             ` [PATCH 9/9] net: move am79c961's " Uwe Kleine-König
  7 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-04 19:56 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Andrew Morton, Avuton Olrich, Antonino Daplas

A pointer to cfag12864bfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Avuton Olrich <avuton@gmail.com>
Cc: Antonino Daplas <adaplas@gmail.com>
---
 drivers/auxdisplay/cfag12864bfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c
index fe3a865..b0ca5a4 100644
--- a/drivers/auxdisplay/cfag12864bfb.c
+++ b/drivers/auxdisplay/cfag12864bfb.c
@@ -81,7 +81,7 @@ static struct fb_ops cfag12864bfb_ops = {
 	.fb_mmap = cfag12864bfb_mmap,
 };
 
-static int __init cfag12864bfb_probe(struct platform_device *device)
+static int __devinit cfag12864bfb_probe(struct platform_device *device)
 {
 	int ret = -EINVAL;
  	struct fb_info *info = framebuffer_alloc(0, &device->dev);
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* [PATCH 9/9] net: move am79c961's probe function to .devinit.text
  2010-02-03 15:08                                           ` Greg KH
                                                               ` (6 preceding siblings ...)
  2010-02-04 19:56                                             ` [PATCH 8/9] auxdisplay: move cfag12864bfb's " Uwe Kleine-König
@ 2010-02-04 19:56                                             ` Uwe Kleine-König
  2010-02-04 20:05                                               ` David Miller
  2010-02-17 21:15                                               ` patch net-move-am79c961-s-probe-function-to-.devinit.text.patch added to gregkh-2.6 tree gregkh
  7 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-04 19:56 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Roel Kluin, Russell King, netdev, Andrew Morton

A pointer to am79c961_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: netdev@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
---
Hello,

@David Miller: this patch is in patchwork with State: Not Applicable.
Does that mean that netdev isn't the right tree for this patch?

Best regards
Uwe

 drivers/net/arm/am79c961a.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index 164b37e..1c3c1f9 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -680,7 +680,7 @@ static const struct net_device_ops am79c961_netdev_ops = {
 #endif
 };
 
-static int __init am79c961_probe(struct platform_device *pdev)
+static int __devinit am79c961_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct net_device *dev;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 197+ messages in thread

* Re: [PATCH 9/9] net: move am79c961's probe function to .devinit.text
  2010-02-04 19:56                                             ` [PATCH 9/9] net: move am79c961's " Uwe Kleine-König
@ 2010-02-04 20:05                                               ` David Miller
  2010-02-04 20:06                                                 ` Uwe Kleine-König
  2010-02-17 21:15                                               ` patch net-move-am79c961-s-probe-function-to-.devinit.text.patch added to gregkh-2.6 tree gregkh
  1 sibling, 1 reply; 197+ messages in thread
From: David Miller @ 2010-02-04 20:05 UTC (permalink / raw)
  To: u.kleine-koenig; +Cc: gregkh, linux-kernel, 12o3l, rmk+kernel, netdev, akpm

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Thu,  4 Feb 2010 20:56:57 +0100

> @David Miller: this patch is in patchwork with State: Not Applicable.
> Does that mean that netdev isn't the right tree for this patch?

I was under the impression that someone would pick up the
whole set as a unit.

If you want me to take it into net-next-2.6 I can.

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 4/9] x86: move hp-wmi's probe function to .devinit.text
  2010-02-04 19:56                                             ` [PATCH 4/9] x86: move hp-wmi's probe function to .devinit.text Uwe Kleine-König
@ 2010-02-04 20:05                                               ` Matthew Garrett
  0 siblings, 0 replies; 197+ messages in thread
From: Matthew Garrett @ 2010-02-04 20:05 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Frans Pop, Larry Finger, Len Brown,
	Helge Deller, Andrew Morton

On Thu, Feb 04, 2010 at 08:56:52PM +0100, Uwe Kleine-König wrote:
> A pointer to hp_wmi_bios_setup is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Frans Pop <elendil@planet.nl>
> Cc: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Len Brown <lenb@kernel.org>
> Cc: Helge Deller <deller@gmx.de>
> Cc: Matthew Garrett <mjg@redhat.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>

Acked-by: Matthew Garrett <mjg@redhat.com>

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 9/9] net: move am79c961's probe function to .devinit.text
  2010-02-04 20:05                                               ` David Miller
@ 2010-02-04 20:06                                                 ` Uwe Kleine-König
  2010-02-12 20:11                                                   ` David Miller
  2010-02-17 20:46                                                   ` Greg KH
  0 siblings, 2 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-04 20:06 UTC (permalink / raw)
  To: David Miller; +Cc: gregkh, linux-kernel, 12o3l, rmk+kernel, netdev, akpm

On Thu, Feb 04, 2010 at 12:05:01PM -0800, David Miller wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Date: Thu,  4 Feb 2010 20:56:57 +0100
> 
> > @David Miller: this patch is in patchwork with State: Not Applicable.
> > Does that mean that netdev isn't the right tree for this patch?
> 
> I was under the impression that someone would pick up the
> whole set as a unit.
Ah, OK.  I hope Greg does exactly that now.

Thanks
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 2/9] platform-drivers: move probe to .devinit.text in drivers/scsi
  2010-02-04 19:56                                             ` [PATCH 2/9] platform-drivers: move probe to .devinit.text in drivers/scsi Uwe Kleine-König
@ 2010-02-04 20:25                                               ` Ralf Baechle
  2010-02-04 21:31                                                 ` Uwe Kleine-König
  0 siblings, 1 reply; 197+ messages in thread
From: Ralf Baechle @ 2010-02-04 20:25 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Andrew Morton, David Brownell,
	Dmitri Vorobiev, Henrik Kretzschmar, James Bottomley,
	Kay Sievers, peter fuerst, Thomas Bogendoerfer

On Thu, Feb 04, 2010 at 08:56:50PM +0100, Uwe Kleine-König wrote:

> A pointer to a probe callback is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.

sgiwd93 bits looks good, so

Acked-by: Ralf Baechle <ralf@linux-mips.org>

The IP22 hardware doesn't support hotplugging so this bug isn't dangerous.

  Ralf

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 1/9] platform-drivers: move probe to .devinit.text in arch/arm
  2010-02-04 19:56                                             ` [PATCH 1/9] platform-drivers: move probe to .devinit.text in arch/arm Uwe Kleine-König
@ 2010-02-04 20:56                                               ` Dmitry Eremin-Solenikov
  2010-02-04 21:09                                                 ` Kristoffer Ericson
  2010-02-04 21:20                                               ` Arnaud Patard
  1 sibling, 1 reply; 197+ messages in thread
From: Dmitry Eremin-Solenikov @ 2010-02-04 20:56 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Andrew Morton, Arnaud Patard, Ben Dooks,
	Eric Miao, Kristoffer Ericson, Liam Girdwood, Paul Sokolovsky,
	Richard Purdie, Russell King

On Thu, Feb 04, 2010 at 08:56:49PM +0100, Uwe Kleine-König wrote:
> A pointer to a probe callback is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
> 
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
> Cc: Eric Miao <eric.miao@marvell.com>
> Cc: Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
> Cc: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
> Cc: Paul Sokolovsky <pmiscml@gmail.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>

sharpsl_pm part:
Acked-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>

-- 
With best wishes
Dmitry


^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 1/9] platform-drivers: move probe to .devinit.text in arch/arm
  2010-02-04 20:56                                               ` Dmitry Eremin-Solenikov
@ 2010-02-04 21:09                                                 ` Kristoffer Ericson
  0 siblings, 0 replies; 197+ messages in thread
From: Kristoffer Ericson @ 2010-02-04 21:09 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov
  Cc: Uwe Kleine-König, Greg KH, linux-kernel, Andrew Morton,
	Arnaud Patard, Ben Dooks, Eric Miao, Kristoffer Ericson,
	Liam Girdwood, Paul Sokolovsky, Richard Purdie, Russell King

On Thu, 4 Feb 2010 23:56:06 +0300
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:

> On Thu, Feb 04, 2010 at 08:56:49PM +0100, Uwe Kleine-König wrote:
> > A pointer to a probe callback is passed to the core via
> > platform_driver_register and so the function must not disappear when the
> > .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> > unbinding and binding a device to the driver via sysfs will result in an
> > oops as does a device being registered late.
> > 
> > An alternative to this patch is using platform_driver_probe instead of
> > platform_driver_register plus removing the pointer to the probe function
> > from the struct platform_driver.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
> > Cc: Ben Dooks <ben-linux@fluff.org>
> > Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
> > Cc: Eric Miao <eric.miao@marvell.com>
> > Cc: Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
> > Cc: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
> > Cc: Paul Sokolovsky <pmiscml@gmail.com>
> > Cc: Richard Purdie <rpurdie@rpsys.net>
> > Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> 
> sharpsl_pm part:
> Acked-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>

jornada part:
Acked-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>

> 
> -- 
> With best wishes
> Dmitry
> 


-- 
Kristoffer Ericson <kristoffer.ericson@gmail.com>

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 1/9] platform-drivers: move probe to .devinit.text in arch/arm
  2010-02-04 19:56                                             ` [PATCH 1/9] platform-drivers: move probe to .devinit.text in arch/arm Uwe Kleine-König
  2010-02-04 20:56                                               ` Dmitry Eremin-Solenikov
@ 2010-02-04 21:20                                               ` Arnaud Patard
  1 sibling, 0 replies; 197+ messages in thread
From: Arnaud Patard @ 2010-02-04 21:20 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg KH, linux-kernel, Andrew Morton, Ben Dooks,
	Dmitry Baryshkov, Eric Miao, Kristoffer Ericson, Liam Girdwood,
	Paul Sokolovsky, Richard Purdie, Russell King

Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:

> A pointer to a probe callback is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
>
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
> Cc: Eric Miao <eric.miao@marvell.com>
> Cc: Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
> Cc: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
> Cc: Paul Sokolovsky <pmiscml@gmail.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
>  arch/arm/mach-pxa/corgi_ssp.c           |    2 +-
>  arch/arm/mach-pxa/sharpsl_pm.c          |    2 +-
>  arch/arm/mach-s3c2410/h1940-bluetooth.c |    2 +-
>  arch/arm/mach-sa1100/jornada720_ssp.c   |    2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)

For the h1940-bluetooth change :
Acked-by: Arnaud Patard <arnaud.patard@rtp-net.org>


^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 2/9] platform-drivers: move probe to .devinit.text in drivers/scsi
  2010-02-04 20:25                                               ` Ralf Baechle
@ 2010-02-04 21:31                                                 ` Uwe Kleine-König
  0 siblings, 0 replies; 197+ messages in thread
From: Uwe Kleine-König @ 2010-02-04 21:31 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: Greg KH, linux-kernel, Andrew Morton, David Brownell,
	Dmitri Vorobiev, Henrik Kretzschmar, James Bottomley,
	Kay Sievers, peter fuerst, Thomas Bogendoerfer

Hello,

On Thu, Feb 04, 2010 at 09:25:07PM +0100, Ralf Baechle wrote:
> On Thu, Feb 04, 2010 at 08:56:50PM +0100, Uwe Kleine-König wrote:
> 
> > A pointer to a probe callback is passed to the core via
> > platform_driver_register and so the function must not disappear when the
> > .init sections are discarded.  Otherwise (if also having HOTPLUG=y)
> > unbinding and binding a device to the driver via sysfs will result in an
> > oops as does a device being registered late.
> > 
> > An alternative to this patch is using platform_driver_probe instead of
> > platform_driver_register plus removing the pointer to the probe function
> > from the struct platform_driver.
> 
> sgiwd93 bits looks good, so
> 
> Acked-by: Ralf Baechle <ralf@linux-mips.org>
> 
> The IP22 hardware doesn't support hotplugging so this bug isn't dangerous.
You can still trigger it via sysfs.  You need to be root though.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 9/9] net: move am79c961's probe function to .devinit.text
  2010-02-04 20:06                                                 ` Uwe Kleine-König
@ 2010-02-12 20:11                                                   ` David Miller
  2010-02-17 20:46                                                   ` Greg KH
  1 sibling, 0 replies; 197+ messages in thread
From: David Miller @ 2010-02-12 20:11 UTC (permalink / raw)
  To: u.kleine-koenig; +Cc: gregkh, linux-kernel, 12o3l, rmk+kernel, netdev, akpm

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Thu, 4 Feb 2010 21:06:38 +0100

> On Thu, Feb 04, 2010 at 12:05:01PM -0800, David Miller wrote:
>> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>> Date: Thu,  4 Feb 2010 20:56:57 +0100
>> 
>> > @David Miller: this patch is in patchwork with State: Not Applicable.
>> > Does that mean that netdev isn't the right tree for this patch?
>> 
>> I was under the impression that someone would pick up the
>> whole set as a unit.
> Ah, OK.  I hope Greg does exactly that now.

I've tossed this into my net-next-2.6 tree anyways to make sure it
doesn't get lost.

Thanks.

^ permalink raw reply	[flat|nested] 197+ messages in thread

* Re: [PATCH 9/9] net: move am79c961's probe function to .devinit.text
  2010-02-04 20:06                                                 ` Uwe Kleine-König
  2010-02-12 20:11                                                   ` David Miller
@ 2010-02-17 20:46                                                   ` Greg KH
  1 sibling, 0 replies; 197+ messages in thread
From: Greg KH @ 2010-02-17 20:46 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: David Miller, gregkh, linux-kernel, 12o3l, rmk+kernel, netdev, akpm

On Thu, Feb 04, 2010 at 09:06:38PM +0100, Uwe Kleine-König wrote:
> On Thu, Feb 04, 2010 at 12:05:01PM -0800, David Miller wrote:
> > From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > Date: Thu,  4 Feb 2010 20:56:57 +0100
> > 
> > > @David Miller: this patch is in patchwork with State: Not Applicable.
> > > Does that mean that netdev isn't the right tree for this patch?
> > 
> > I was under the impression that someone would pick up the
> > whole set as a unit.
> Ah, OK.  I hope Greg does exactly that now.

I have now done this.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 197+ messages in thread

* patch net-move-am79c961-s-probe-function-to-.devinit.text.patch added to gregkh-2.6 tree
  2010-02-04 19:56                                             ` [PATCH 9/9] net: move am79c961's " Uwe Kleine-König
  2010-02-04 20:05                                               ` David Miller
@ 2010-02-17 21:15                                               ` gregkh
  1 sibling, 0 replies; 197+ messages in thread
From: gregkh @ 2010-02-17 21:15 UTC (permalink / raw)
  To: u.kleine-koenig, 12o3l, akpm, gregkh, netdev, rmk+kernel


This is a note to let you know that I've just added the patch titled

    Subject: net: move am79c961's probe function to .devinit.text

to my gregkh-2.6 tree.  Its filename is

    net-move-am79c961-s-probe-function-to-.devinit.text.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


From u.kleine-koenig@pengutronix.de  Wed Feb 17 12:45:57 2010
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Thu,  4 Feb 2010 20:56:57 +0100
Subject: net: move am79c961's probe function to .devinit.text
To: Greg KH <gregkh@suse.de>
Cc: Roel Kluin <12o3l@tiscali.nl>, Russell King <rmk+kernel@arm.linux.org.uk>, netdev@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Message-ID: <1265313417-5568-9-git-send-email-u.kleine-koenig@pengutronix.de>

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

A pointer to am79c961_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: <netdev@vger.kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/arm/am79c961a.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -680,7 +680,7 @@ static const struct net_device_ops am79c
 #endif
 };
 
-static int __init am79c961_probe(struct platform_device *pdev)
+static int __devinit am79c961_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct net_device *dev;


^ permalink raw reply	[flat|nested] 197+ messages in thread

end of thread, other threads:[~2010-02-17 21:15 UTC | newest]

Thread overview: 197+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-16  5:13 [GIT PATCH] USB patches for 2.6.30-git Greg KH
     [not found] ` <1245129858-23818-12-git-send-email-gregkh@suse.de>
2009-06-16  6:05   ` [PATCH 012/143] USB: move twl4030_usb's probe function to .devinit.text Uwe Kleine-König
2009-06-16  6:20     ` Greg KH
2009-06-16  9:14       ` Uwe Kleine-König
2009-06-16 16:21         ` Greg KH
2009-06-16 17:59           ` Uwe Kleine-König
2009-06-16 18:00             ` Greg KH
2009-06-16 18:23               ` Uwe Kleine-König
2009-06-19 13:42                 ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
2009-06-19 14:11                   ` Greg KH
2009-06-19 14:43                     ` Uwe Kleine-König
2009-06-29  7:55                       ` Uwe Kleine-König
2009-07-11  3:34                         ` Greg KH
2009-07-11 10:00                           ` Uwe Kleine-König
2009-07-11 17:05                             ` Greg KH
2009-07-11 20:52                               ` [PATCH] move acornfb's probe function to .devinit.text Uwe Kleine-König
2009-07-11 20:52                                 ` Uwe Kleine-König
2009-07-11 20:52                                 ` [PATCH] move am79c961's " Uwe Kleine-König
2009-07-11 20:52                                   ` [PATCH] move arcfb's " Uwe Kleine-König
2009-07-11 20:52                                     ` [PATCH] move at91_ether's " Uwe Kleine-König
2009-07-11 20:52                                       ` [PATCH] move cfag12864bfb's " Uwe Kleine-König
2009-07-11 20:52                                         ` [PATCH] move leds-clevo-mail's " Uwe Kleine-König
2009-07-11 20:52                                           ` [PATCH] move cobalt-lcd's " Uwe Kleine-König
2009-07-11 20:52                                             ` [PATCH] move corgi-ssp's " Uwe Kleine-König
2009-07-11 20:52                                               ` [PATCH] move efifb's " Uwe Kleine-König
2009-07-11 20:52                                                 ` [PATCH] move epson1355fb's " Uwe Kleine-König
2009-07-11 20:52                                                   ` [PATCH] move sh_flctl's " Uwe Kleine-König
2009-07-11 20:52                                                     ` [PATCH] move gbefb's " Uwe Kleine-König
2009-07-11 20:52                                                       ` [PATCH] move h1940-bt's " Uwe Kleine-König
2009-07-11 20:52                                                         ` [PATCH] move hgafb's " Uwe Kleine-König
2009-07-11 20:52                                                           ` [PATCH] move hitfb's " Uwe Kleine-König
2009-07-11 20:52                                                             ` [PATCH] move hp680-bl's " Uwe Kleine-König
2009-07-11 20:52                                                               ` [PATCH] move hp-wmi's " Uwe Kleine-König
2009-07-11 20:52                                                                 ` [PATCH] move jazzsonic's " Uwe Kleine-König
2009-07-11 20:52                                                                   ` [PATCH] move jornada_ssp's " Uwe Kleine-König
2009-07-11 20:52                                                                     ` [PATCH] move macsonic's " Uwe Kleine-König
2009-07-11 20:52                                                                       ` [PATCH] move meth's " Uwe Kleine-König
2009-07-11 20:52                                                                         ` [PATCH] move omap24xxcam's " Uwe Kleine-König
2009-07-11 20:52                                                                           ` [PATCH] move omap_hdq's " Uwe Kleine-König
2009-07-11 20:52                                                                             ` [PATCH] move i2c_omap's " Uwe Kleine-König
2009-07-11 20:52                                                                               ` [PATCH] move mmci-omap-hs's " Uwe Kleine-König
2009-07-11 20:52                                                                                 ` [PATCH] move orion_nand's " Uwe Kleine-König
2009-07-11 20:52                                                                                   ` [PATCH] move q40fb's " Uwe Kleine-König
2009-07-11 20:52                                                                                     ` [PATCH] move s3c241xfb's " Uwe Kleine-König
2009-07-11 20:52                                                                                       ` [PATCH] move sa11x0-fb's " Uwe Kleine-König
2009-07-11 20:52                                                                                         ` [PATCH] move sb1250-mac's " Uwe Kleine-König
2009-07-11 20:52                                                                                           ` [PATCH] move sgiseeq's " Uwe Kleine-König
2009-07-11 20:53                                                                                             ` [PATCH] move sgivwfb's " Uwe Kleine-König
2009-07-11 20:53                                                                                               ` [PATCH] move sgiwd93's " Uwe Kleine-König
2009-07-11 20:53                                                                                                 ` [PATCH] move sharpsl-pm's " Uwe Kleine-König
2009-07-11 20:53                                                                                                   ` [PATCH] move sh_mobile_lcdc_fb's " Uwe Kleine-König
2009-07-11 20:53                                                                                                     ` [PATCH] move snirm_53c710's " Uwe Kleine-König
2009-07-11 20:53                                                                                                       ` [PATCH] move stk17ta8's " Uwe Kleine-König
2009-07-11 20:53                                                                                                         ` [PATCH] move omap_udc's " Uwe Kleine-König
2009-07-11 20:53                                                                                                           ` [PATCH] move vesafb's " Uwe Kleine-König
2009-07-11 20:53                                                                                                             ` [PATCH] move vfb's " Uwe Kleine-König
2009-07-11 20:53                                                                                                               ` [PATCH] move vga16fb's " Uwe Kleine-König
2009-07-11 20:53                                                                                                                 ` [PATCH] move w100fb's " Uwe Kleine-König
2009-07-11 20:53                                                                                                                   ` [PATCH] move xtsonic's " Uwe Kleine-König
2009-07-11 22:26                                                                                                                   ` [PATCH] move w100fb's " Ian molton
2009-07-11 22:30                                                                                                           ` [PATCH] move omap_udc's " David Brownell
2009-07-12  8:35                                                                                                             ` Uwe Kleine-König
2009-07-12  8:47                                                                                                               ` Russell King
2009-07-12  9:30                                                                                                                 ` David Brownell
2009-07-12 13:17                                                                                                                 ` Russell King
2009-07-12 20:07                                                                                                                   ` David Brownell
2009-07-12 22:21                                                                                                                   ` David Brownell
2009-07-13  9:10                                                                                                                     ` Uwe Kleine-König
2009-07-13 21:31                                                                                                                       ` David Brownell
2009-07-12  9:37                                                                                                               ` David Brownell
2009-07-12 20:48                                                                                                             ` Uwe Kleine-König
2009-07-12 22:12                                                                                                               ` David Brownell
2009-07-13  9:12                                                                                                               ` [PATCH] don't add clevo_mail_led_driver's probe function to the driver struct Uwe Kleine-König
2009-08-13  9:59                                                                                                         ` [PATCH] move stk17ta8's probe function to .devinit.text Jiri Kosina
2009-10-09 15:24                                                                                                         ` Jiri Kosina
2009-10-09 18:33                                                                                                           ` Alessandro Zummo
2009-10-09 21:22                                                                                                             ` Jiri Kosina
2009-10-09 21:55                                                                                                               ` Alessandro Zummo
2009-07-12  0:36                                                                                           ` [PATCH] move sb1250-mac's " Maciej W. Rozycki
2009-07-13 19:37                                                                                   ` [PATCH] move orion_nand's " Nicolas Pitre
2009-07-14  8:09                                                                                     ` Uwe Kleine-König
2009-07-14 16:12                                                                                       ` Nicolas Pitre
2009-07-14 17:17                                                                                         ` Uwe Kleine-König
2009-07-21 20:46                                                                                         ` [PATCH] register orion_nand using platform_driver_probe Uwe Kleine-König
2009-07-21 20:46                                                                                           ` Uwe Kleine-König
2009-07-21 22:26                                                                                           ` Nicolas Pitre
2009-07-21 22:26                                                                                             ` Nicolas Pitre
2009-07-22  5:17                                                                                             ` Uwe Kleine-König
2009-07-22  5:17                                                                                               ` Uwe Kleine-König
2009-07-11 22:29                                                                                 ` [PATCH] move mmci-omap-hs's probe function to .devinit.text David Brownell
2009-07-21 20:36                                                                                   ` [PATCH] register mmci-omap-hs using platform_driver_probe Uwe Kleine-König
2009-07-22 17:38                                                                                     ` David Brownell
2009-07-21 15:14                                                                       ` [PATCH] move macsonic's probe function to .devinit.text Finn Thain
2009-07-21 15:40                                                                         ` [PATCH] macsonic, jazzsonic - fix oops on module unload Finn Thain
2009-07-21 19:22                                                                           ` David Miller
2009-07-21 19:20                                                                         ` [PATCH] move macsonic's probe function to .devinit.text Uwe Kleine-König
2009-07-21 19:20                                                                         ` David Miller
2009-07-21 19:40                                                                           ` Uwe Kleine-König
2009-07-21 19:41                                                                             ` David Miller
2009-09-19 23:09                                                     ` [PATCH] move sh_flctl's " David Woodhouse
2009-09-21  7:43                                                       ` Uwe Kleine-König
2009-07-13 13:51                                                 ` [PATCH] move efifb's " Peter Jones
2009-07-13  8:44                                               ` [PATCH] move corgi-ssp's " Eric Miao
2009-07-13  9:01                                                 ` Uwe Kleine-König
2009-07-11 22:27                                       ` [PATCH] move at91_ether's " David Brownell
2009-07-21 20:11                                         ` [PATCH] register at91_ether using platform_driver_probe Uwe Kleine-König
2009-07-22 17:37                                           ` David Brownell
2009-07-22 17:46                                           ` Andrew Victor
2009-07-22 18:24                                             ` David Miller
2009-09-07 14:19                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
2010-01-22 17:06                                 ` Uwe Kleine-König
2010-01-22 17:38                                   ` Greg KH
2010-01-22 19:49                                     ` Uwe Kleine-König
2010-01-22 23:49                                       ` Dmitry Torokhov
2010-01-23  9:49                                         ` Uwe Kleine-König
2010-01-25 17:14                                           ` Dmitry Torokhov
2010-01-25 19:25                                             ` Uwe Kleine-König
2010-01-25 19:31                                               ` Dmitry Torokhov
2010-01-23 20:35                                       ` [PATCH 01/29] move acornfb's probe function to .devinit.text Uwe Kleine-König
2010-01-23 20:35                                         ` Uwe Kleine-König
2010-01-23 23:25                                         ` Alexey Dobriyan
2010-01-23 23:28                                         ` Alexey Dobriyan
2010-01-26  8:46                                           ` Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 02/29] move am79c961's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 03/29] move arcfb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 04/29] move cfag12864bfb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 05/29] move cobalt-lcd's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 06/29] move corgi-ssp's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 07/29] move efifb's " Uwe Kleine-König
2010-01-26 16:20                                         ` Peter Jones
2010-01-23 20:35                                       ` [PATCH 08/29] move epson1355fb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 09/29] move gbefb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 10/29] move h1940-bt's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 11/29] move hgafb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 12/29] move hitfb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 13/29] move hp-wmi's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 14/29] move jornada_ssp's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 15/29] move omap24xxcam's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 16/29] move omap_hdq's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 17/29] move i2c_omap's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 18/29] move q40fb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 19/29] move s3c241xfb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 20/29] move sa11x0-fb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 21/29] move sgivwfb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 22/29] move sgiwd93's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 23/29] move sharpsl-pm's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 24/29] move sh_mobile_lcdc_fb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 25/29] move snirm_53c710's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 26/29] move vesafb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 27/29] move vfb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 28/29] move vga16fb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 29/29] move w100fb's " Uwe Kleine-König
2010-01-24 21:09                                       ` [PATCH] platform_driver_register: warn if probe is in .init.text OGAWA Hirofumi
2010-01-26  8:47                                         ` Uwe Kleine-König
2010-01-28  1:14                                           ` Greg KH
2010-01-30 20:44                                             ` Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 1/7] modpost: members of *driver structs should not point to __init functions Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 2/7] modpost: define ALL_XYX{IN,EX}IT_SECTIONS Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 3/7] modpost: give most mismatch constants a better name Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 4/7] modpost: pass around const struct sectioncheck * instead of enum mismatch Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 5/7] modpost: remove now unused NO_MISMATCH constant Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 6/7] modpost: make symbol white list a per mismatch type variable Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 7/7] modpost: don't allow *driver to reference .init.* Uwe Kleine-König
2010-01-31 16:02                                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Sam Ravnborg
2010-01-31 20:13                                                 ` Uwe Kleine-König
2010-02-02 15:25                                                   ` Michal Marek
2010-02-01 14:57                                               ` [PATCH] i2c/imx: don't add probe function to the driver struct Uwe Kleine-König
2010-02-01 14:57                                                 ` Uwe Kleine-König
2010-01-26  8:59                                     ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
2010-01-26 14:30                                       ` Greg KH
2010-01-28 18:02                                       ` Greg KH
2010-02-03  9:42                                         ` Uwe Kleine-König
2010-02-03 15:08                                           ` Greg KH
2010-02-04 19:56                                             ` [PATCH 1/9] platform-drivers: move probe to .devinit.text in arch/arm Uwe Kleine-König
2010-02-04 20:56                                               ` Dmitry Eremin-Solenikov
2010-02-04 21:09                                                 ` Kristoffer Ericson
2010-02-04 21:20                                               ` Arnaud Patard
2010-02-04 19:56                                             ` [PATCH 2/9] platform-drivers: move probe to .devinit.text in drivers/scsi Uwe Kleine-König
2010-02-04 20:25                                               ` Ralf Baechle
2010-02-04 21:31                                                 ` Uwe Kleine-König
2010-02-04 19:56                                             ` [PATCH 4/9] x86: move hp-wmi's probe function to .devinit.text Uwe Kleine-König
2010-02-04 20:05                                               ` Matthew Garrett
2010-02-04 19:56                                             ` [PATCH 5/9] i2c: move i2c_omap's " Uwe Kleine-König
2010-02-04 19:56                                             ` [PATCH 6/9] w1: move omap_hdq's " Uwe Kleine-König
2010-02-04 19:56                                             ` [PATCH 7/9] media: move omap24xxcam's " Uwe Kleine-König
2010-02-04 19:56                                             ` [PATCH 8/9] auxdisplay: move cfag12864bfb's " Uwe Kleine-König
2010-02-04 19:56                                             ` [PATCH 9/9] net: move am79c961's " Uwe Kleine-König
2010-02-04 20:05                                               ` David Miller
2010-02-04 20:06                                                 ` Uwe Kleine-König
2010-02-12 20:11                                                   ` David Miller
2010-02-17 20:46                                                   ` Greg KH
2010-02-17 21:15                                               ` patch net-move-am79c961-s-probe-function-to-.devinit.text.patch added to gregkh-2.6 tree gregkh
2009-09-21  7:54                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
2009-07-11 18:59                             ` Greg KH
2009-07-11 20:46                               ` Uwe Kleine-König
2009-07-16 22:58                                 ` Greg KH
2009-07-17  8:34                                   ` Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.