* Re: [PATCH/RFC v3 0/7] Videobuf2 framework
From: Kyungmin Park @ 2010-10-20 7:18 UTC (permalink / raw)
To: Hans Verkuil; +Cc: Marek Szyprowski, linux-media, pawel
In-Reply-To: <201010200914.32868.hverkuil@xs4all.nl>
On Wed, Oct 20, 2010 at 4:14 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> On Wednesday, October 20, 2010 08:41:06 Marek Szyprowski wrote:
>> Hello,
>>
>> As I promissed I continue the development of the VideoBuf2 at Samsung
>> until Pawel finds some spare time to help us. This is a third version of
>> the framework. Besides the minor bugfixes here and there I've added a
>> complete read() callback emulator. This emulator provides 2 types of
>> read() operation - 'streaming' and 'one shot'. It is suitable to replace
>> both videobuf_read_stream() and videobuf_read_one() methods from the old
>> videobuf.
>
> One thing I never understood: what is the point of supporting 'one shot' read
> mode? Why not support just streaming? Does anyone know?
>
> Another question: how hard is it to support write mode as well? I think
> vb2 should support both. I suspect that once we have a read emulator it isn't
> difficult to make a write emulator too.
One thing consideration is that with this implementation we can't meet
merge window for 2.6.37.
How do you think?
Thank you,
Kyungmin Park
>
> A last remark: the locking has changed recently in videobuf due to the work
> done on eliminating the BKL. It's probably a good idea to incorporate those
> changes as well in vb2.
>
> Regards,
>
> Hans
>
>>
>> Taking into account the size of the patches and the number of lines I've
>> changed, I've decided to keep the Pawel signed-off attribute and
>> authorship to correctly credit him. If this is against kernel rules,
>> feel free to let me know.
>>
>> Best regards
>> --
>> Marek Szyprowski
>> Samsung Poland R&D Center
>>
>>
>> Changes since V2:
>> =================
>> - added read() emulator (see patch #5/7)
>> - fixed lack of parentheses in macro definitions (caused side effects
>> in some places)
>> - added a separate check for VM_READ or VM_WRITE in vb2_mmap()
>> - added vb2_is_streaming(), vb2_lock and vb2_unlock inlines
>> - updated vivi driver with the new read() emulator
>>
>> Changes since V1:
>> =================
>> - removed drv_lock, added start_streaming and stop_streaming callbacks
>>
>>
>> Here is the original Videobuf2 introduction prepared by Pawel:
>> =======================================================================
>>
>> These patches add a new driver framework for Video for Linux 2 driver
>> - Videobuf2.
>>
>> Videobuf2 is intended as a replacement for videobuf, the current driver
>> framework, which will be referred to as "videobuf1" for the remainder
>> of this document.
>>
>> ================================
>> What is videobuf2?
>> ================================
>> Videobuf2 is a Video for Linux 2 API-compatible driver framework for
>> multimedia devices. It acts as an intermediate layer between userspace
>> applications and device drivers. It also provides low-level, modular
>> memory management functions for drivers.
>>
>> Videobuf2 eases driver development, reduces drivers' code size and aids in
>> proper and consistent implementation of V4L2 API in drivers.
>>
>> Videobuf2 memory management backend is fully modular. This allows custom
>> memory management routines for devices and platforms with non-standard
>> memory management requirements to be plugged in, without changing the
>> high-level buffer management functions and API.
>>
>> The framework provides:
>> - implementations of streaming I/O V4L2 ioctls and file operations
>> - high-level video buffer, video queue and state management functions
>> - video buffer memory allocation and management
>>
>> ================================
>> Why a new framework?
>> ================================
>> There have been many discussions in the V4L2 community about the feasibility
>> of writing a new framework, as opposed to fixing the existing one. It has been
>> agreed though that:
>> - videobuf1 has major flaws and an attempt to fix it would end up in rewriting
>> most of the code
>> - many drivers depend on videobuf1 and since the changes would be major,
>> an effort to adapt and test them all would not be realistically possible
>>
>> Due to the problems with videobuf most new drivers cannot use it. This leads
>> to code replication and overcomplicated drivers.
>>
>> ================================
>> What is wrong with videobuf1?
>> ================================
>> There are many problems with the current videobuf implementation. During a V4L2
>> mini-summit in Helsinki in June 2010, two presentations were delivered
>> on this topic:
>> - Laurent Pinchart "videobuf - the good, the bad and the ugly"
>> http://linuxtv.org/downloads/presentations/summit_jun_2010/20100614-v4l2_summit-videobuf.pdf
>> - Pawel Osciak "Future of the videobuf framework"
>> http://linuxtv.org/downloads/presentations/summit_jun_2010/Videobuf_Helsinki_June2010.pdf
>>
>> These presentations highlighted many problems with videobuf. The most prominent
>> include:
>>
>> - V4L2 API violations and wrong memory management design
>> - it is impossible to pause streaming (buffers are freed on streamoff)
>> - VIDIOC_REQBUFS(0) does not free memory
>> - it is impossible to reallocate memory with VIDIOC_REQBUFS
>> - video memory is allocated on mmap, qbuf or even on page fault,
>> freed on unmap, streamoff or explicitly by drivers
>> - per-buffer waitqueues
>> - not extensible enough and thus not ready for new platforms and uses,
>> especially considering embedded multimedia devices
>> - very hard to add new memory handling routines and custom memory allocators
>> - no or poor support for handling cache coherency, IOMMUs,
>> - poor flexibility - only one do-it-all function for handling memory pinning,
>> cache, sg-list creation, etc...
>> - unused fields, code duplication, vague/inconsistent naming, obscure usage in
>> some places...
>>
>> Many driver authors expressed their frustration with videobuf. Developers
>> acknowledge its merits and would like to use it, but due mostly to its
>> inflexible memory allocation schemes they are unable to do so.
>>
>> ================================
>> Main goals of the redesign
>> ================================
>> - correct V4L2 API implementation, fixing videobuf1 problems and shortcomings
>> - full separation between queue management and memory management
>> - fully flexible, pluggable memory allocators and memory handling routines
>> - more specialized driver callbacks, called at different points
>> - support for new V4L2 API extensions, such as multi-planar video buffers
>>
>> ================================
>> Driver callbacks
>> ================================
>> Driver callbacks have been redesigned for symmetry:
>> - buf_init - called once, after memory is allocated or after a new USERPTR
>> buffer is queued; can be used e.g. to pin pages, verify contiguity, set up
>> IOMMU mappings, etc.
>> - buf_prepare - called on each QBUF; can be used e.g. for cache sync, copying
>> to bounce buffers, etc.
>> - buf_finish - called on each DQBUF; can be used e.g. for cache sync, copying
>> back from bounce buffers, etc.
>> - buf_cleanup - called before freeing/releasing memory; can be used e.g. for
>> unmapping memory, etc.
>>
>> The remaining driver callbacks have been slightly redesigned:
>> - queue_negotiate - now incorporates multi-planar extensions; drivers return
>> required number of buffers and planes per buffer
>> - plane_setup - drivers return plane sizes
>> Those two callbacks replace the old buf_setup.
>>
>> - buf_queue - basically stays the same
>>
>> ================================
>> Memory allocators and handling
>> ================================
>> Memory handling has been designed to allow more customization than in the
>> original videobuf. For this memory allocation ops have been slightly redesigned,
>> and have become fully replaceable and an allocator context struct have been
>> introduced.
>>
>> Allocator context is intended to provide memory operations to videobuf and also
>> for storing allocator private data, if required, although simpler allocators
>> do not have to use this feature. Private data can be added by embedding the
>> context struct inside their own structures:
>>
>> struct vb2_alloc_ctx {
>> const struct vb2_mem_ops *mem_ops;
>> };
>>
>> struct vb2_foo_alloc_conf {
>> struct vb2_alloc_ctx alloc_ctx;
>> /* Allocator private data here */
>> };
>>
>> Moreover, a buffer context structure concept has been introduced. Allocators
>> return their own, custom, per-buffer structures on every allocation. This
>> structure is then used as a "cookie" and passed to other memory handling
>> methods called for its corresponding buffer.
>>
>> Memory operations, stored in the allocator context, can be replaced if
>> needed by drivers on a per-function basis and functions from other allocators
>> or drivers can be reused as well. A full list with documentation can be found
>> in the videobuf2-core.h file.
>>
>> It is also possible, although not required, to assign different contexts per
>> plane. This may be useful for drivers that need to use different memory types
>> for different planes. An example may be a driver that stores video data in the
>> first plane, which has to be allocated from a device-accessible memory area,
>> and metadata in the second plane, which does not have to be stored in
>> a device-accessible memory.
>>
>> An good example of integrating a more advanced allocator, the recently discussed
>> on this list CMA (contiguous memory allocator), can be found in videobuf2-cma.*.
>>
>> ================================
>> Other changes
>> ================================
>> The changes described above are the main changes in videobuf2. Most of the core
>> API has remained the same or very similar, although its implementation has been
>> fully rewritten. Some more visible changes include:
>>
>> - Memory is now properly allocated on REQBUFS and can be freed and reallocated
>> there as well.
>> - It is now possible to pause and resume streaming with streamon/streamoff,
>> without freeing the buffers.
>> - V4L2 API-related, userspace-visible metadata, such as inputs, timestamps, etc.
>> are no longer stored in videobuf buffer structure, but in an actual
>> v4l2_buffer struct (idea borrowed from Laurent Pinchart). I felt that driver
>> authors would prefer to use V4L2 API-based structures of videobuf custom
>> structures where possible. It also eases copying v4l2_buffer-related data
>> from/to userspace.
>> - Buffers do not include waitqueues anymore. One, global, per-queue waitqueue
>> for done buffers has been introduced instead. Per-buffer waitqueues were not
>> very useful and introduced additional complications in code.
>> With this, drivers have gained the ability of dequeuing buffers out-of-order
>> as well.
>> - Buffer states are not handled jointly by both videobuf and driver anymore,
>> I felt it was not required and confusing for driver authors
>> - Some fields that were less useful have been removed and naming of others
>> have been changed to better reflect their function.
>> - Other then reqbufs, ioctl implementations have remained almost the same
>> and behave in the same way,
>>
>>
>> Please see documentation in videobuf2-core.c and videobuf2-core.h for more
>> details and the patch porting vivi to videobuf2 for how to port existing
>> drivers to videobuf2.
>>
>> This is a preliminary version intended for review, but has already been tested
>> for multiple drivers and different memory handling implementations. DMA-SG
>> implementation is not included yet.
>>
>> The CMA allocator patches are attached for reference, to show how a more
>> complicated allocator can be integrated into the framework.
>>
>> Any comments will be very much appreciated!
>>
>> Best regards,
>> Pawel Osciak
>> Linux Platform Group
>> Samsung Poland R&D Center
>>
>> =======================================================================
>>
>> Patch summary:
>>
>> Pawel Osciak (6):
>> v4l: add videobuf2 Video for Linux 2 driver framework
>> v4l: videobuf2: add generic memory handling routines
>> v4l: videobuf2: add vmalloc allocator
>> v4l: videobuf2: add DMA coherent allocator
>> v4l: vivi: port to videobuf2
>> v4l: videobuf2: add CMA allocator
>>
>> Marek Szyprowski (1):
>> v4l: videobuf2: add read() emulator
>>
>> drivers/media/video/Kconfig | 23 +-
>> drivers/media/video/Makefile | 6 +
>> drivers/media/video/videobuf2-cma.c | 250 ++++
>> drivers/media/video/videobuf2-core.c | 1726 ++++++++++++++++++++++++++
>> drivers/media/video/videobuf2-dma-coherent.c | 208 ++++
>> drivers/media/video/videobuf2-memops.c | 199 +++
>> drivers/media/video/videobuf2-vmalloc.c | 177 +++
>> drivers/media/video/vivi.c | 348 +++---
>> include/media/videobuf2-cma.h | 25 +
>> include/media/videobuf2-core.h | 392 ++++++
>> include/media/videobuf2-dma-coherent.h | 21 +
>> include/media/videobuf2-memops.h | 31 +
>> include/media/videobuf2-vmalloc.h | 16 +
>> 13 files changed, 3258 insertions(+), 164 deletions(-)
>> create mode 100644 drivers/media/video/videobuf2-cma.c
>> create mode 100644 drivers/media/video/videobuf2-core.c
>> create mode 100644 drivers/media/video/videobuf2-dma-coherent.c
>> create mode 100644 drivers/media/video/videobuf2-memops.c
>> create mode 100644 drivers/media/video/videobuf2-vmalloc.c
>> create mode 100644 include/media/videobuf2-cma.h
>> create mode 100644 include/media/videobuf2-core.h
>> create mode 100644 include/media/videobuf2-dma-coherent.h
>> create mode 100644 include/media/videobuf2-memops.h
>> create mode 100644 include/media/videobuf2-vmalloc.h
>>
>>
>
> --
> Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [lm-sensors] Driver for SMSC SCH5627 needed
From: Rainer Koenig @ 2010-10-20 7:17 UTC (permalink / raw)
To: lm-sensors
In-Reply-To: <4CBD8E44.8070909@ts.fujitsu.com>
Hi Juerg,
Juerg Haefliger schrieb:
>> I have a board that has a SMSC SCH5627 chip on it. sensors detect report
>> "unknow chip SMSC 0xc601".
>> Where can I get a driver for this chip?
>>
>
> First we need a datasheet. Then we can figure out if we already have a
> driver that supports a similar device and could be easily extended. No
> datasheet usually means no driver.
>
I perfectly understand that. So we used our contacts to SMSC to ask them
for a chip documentation that is not under NDA. Didn't get an answer yet,
but still hoping.
> What board model/vendor is this? Dell machine?
>
The board is a D2984 board used in the ESPRIMO E5645 from Fujitsu
Technology
Solutions. Data sheet is here:
http://docs.ts.fujitsu.com/dl.aspx?idO300628-7547-44b6-ac82-172ebae232c1
Best regards
Rainer
--
Dipl.-Inf. (FH) Rainer Koenig
Project Manager Linux Clients
Dept. TSP WPS R&D SW OSE
Fujitsu Technology Solutions
Bürgermeister-Ullrich-Str. 100
86199 Augsburg
Germany
Telephone: +49-821-804-3321
Telefax: +49-821-804-2131
Mail: mailto:Rainer.Koenig@ts.fujitsu.com
Internet ts.fujtsu.com
Company Details ts.fujitsu.com/imprint.html
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply
* [U-Boot] Hello Dear.
From: Dempsey Theophlus @ 2010-10-20 7:17 UTC (permalink / raw)
To: u-boot
Hello Dear,
?
I am? Dempsey Theophlus.
?
Please I need your urgent help.
?
My father deposited some money in a bank.The money is in US dollars.He deposited this money before he was killed by unknown Gun Men.
My father use to be a nice and generous man.It is very sad to say that he just died this way.May his gentle soul rest in perfect peace.AMEN.
?
My father has being buried and we have completed his three months burial ceremony according to our tradition and customer,now because of the circumstance surrounding the death of my father,I now feel that the best thing to do now is to travel out of country to another country for my safety,that is why I am contacting you to help me transfer this money to your bank in your country and also help me come over to your country for my security and for the investing of this money.
So please I will like you to reply back quickly so that I can give you more details.
?
waiting for your quick reply.
?
Dempsey Theophlus.
^ permalink raw reply
* NFSv4 mounts take longer the fail from ENETUNREACH than NFSv3 mounts.
From: Neil Brown @ 2010-10-20 7:17 UTC (permalink / raw)
To: Linux NFS Mailing List
If I don't have any network configured (except loop-back), and try an NFSv3
mount, then it fails quickly:
....
mount.nfs: portmap query failed: RPC: Remote system error - Network is unreachable
mount.nfs: Network is unreachable
If I try the same thing with a NFSv4 mount, it times out before it fails,
making a much longer delay.
This is because mount.nfs doesn't do a portmap lookup but just leaves
everything to the kernel.
The kernel does an 'rpc_ping()' which sets RPC_TASK_SOFTCONN.
So at least it doesn't retry after the timeout. But given that we have a
clear error, we shouldn't timeout at all.
Unfortunately I cannot see an easy way to fix this.
The place where ENETUNREACH is in xs_tcp_setup_socket. The comment there
says "Retry with the same socket after a delay". The "delay" bit is correct,
the "retry" isn't.
It would seem that we should just add a 'goto out' there if RPC_TASK_SOFTCONN
was set. However we cannot see the task at this point - in fact it seems
that there could be a queue of tasks waiting on this connection. I guess
some could be soft, and some not. ???
So: An suggestions how to get a ENETUNREACH (or ECONNREFUSED or similar) to
fail immediately when RPC_TASK_SOFTCONN is set ???
This affects people who upgrade from openSUSE11.2 (which didn't support v4
mounts) to openSUSE11.3 (which defaults to v4) and who use network-manager
(which configures networks late) and have NFS mounts in /etc/fstab with
either explicit IP addresses or host names that can be resolved without the
network.
This config will work because when the network comes up, network-manager will
re-run the 'init.d/nfs' script. However since 11.3 there is an unpleasant
pause before boot completes.
Thanks,
NeilBrown
^ permalink raw reply
* [U-Boot] [PATCH] FAT: buffer overflow with FAT12/16
From: Wolfgang Denk @ 2010-10-20 7:15 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1287557505-3955-1-git-send-email-sbabic@denx.de>
Dear Stefano Babic,
In message <1287557505-3955-1-git-send-email-sbabic@denx.de> you wrote:
> Last commit 3831530dcb7b71329c272ccd6181f8038b6a6dd0a was intended
> "explicitly specify FAT12/16 root directory parsing buffer size, instead
> of relying on cluster size". Howver, the underlying function requires
> the size of the buffer in blocks, not in bytes, and instead of passing
> a double sector size a request for 1024 blocks is sent. This generates
> a buffer overflow with overwriting of other structure (in the case seen,
> USB structures were overwritten).
>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Mikhail Zolotaryov <lebon@lebon.org.ua>
>
> ---
> fs/fat/fat.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Nice catch!
Applied, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Never worry about theory as long as the machinery does what it's
supposed to do. - R. A. Heinlein
^ permalink raw reply
* Re: [PATCH/RFC v3 0/7] Videobuf2 framework
From: Hans Verkuil @ 2010-10-20 7:14 UTC (permalink / raw)
To: Marek Szyprowski; +Cc: linux-media, pawel, kyungmin.park
In-Reply-To: <1287556873-23179-1-git-send-email-m.szyprowski@samsung.com>
On Wednesday, October 20, 2010 08:41:06 Marek Szyprowski wrote:
> Hello,
>
> As I promissed I continue the development of the VideoBuf2 at Samsung
> until Pawel finds some spare time to help us. This is a third version of
> the framework. Besides the minor bugfixes here and there I've added a
> complete read() callback emulator. This emulator provides 2 types of
> read() operation - 'streaming' and 'one shot'. It is suitable to replace
> both videobuf_read_stream() and videobuf_read_one() methods from the old
> videobuf.
One thing I never understood: what is the point of supporting 'one shot' read
mode? Why not support just streaming? Does anyone know?
Another question: how hard is it to support write mode as well? I think
vb2 should support both. I suspect that once we have a read emulator it isn't
difficult to make a write emulator too.
A last remark: the locking has changed recently in videobuf due to the work
done on eliminating the BKL. It's probably a good idea to incorporate those
changes as well in vb2.
Regards,
Hans
>
> Taking into account the size of the patches and the number of lines I've
> changed, I've decided to keep the Pawel signed-off attribute and
> authorship to correctly credit him. If this is against kernel rules,
> feel free to let me know.
>
> Best regards
> --
> Marek Szyprowski
> Samsung Poland R&D Center
>
>
> Changes since V2:
> =================
> - added read() emulator (see patch #5/7)
> - fixed lack of parentheses in macro definitions (caused side effects
> in some places)
> - added a separate check for VM_READ or VM_WRITE in vb2_mmap()
> - added vb2_is_streaming(), vb2_lock and vb2_unlock inlines
> - updated vivi driver with the new read() emulator
>
> Changes since V1:
> =================
> - removed drv_lock, added start_streaming and stop_streaming callbacks
>
>
> Here is the original Videobuf2 introduction prepared by Pawel:
> =======================================================================
>
> These patches add a new driver framework for Video for Linux 2 driver
> - Videobuf2.
>
> Videobuf2 is intended as a replacement for videobuf, the current driver
> framework, which will be referred to as "videobuf1" for the remainder
> of this document.
>
> ================================
> What is videobuf2?
> ================================
> Videobuf2 is a Video for Linux 2 API-compatible driver framework for
> multimedia devices. It acts as an intermediate layer between userspace
> applications and device drivers. It also provides low-level, modular
> memory management functions for drivers.
>
> Videobuf2 eases driver development, reduces drivers' code size and aids in
> proper and consistent implementation of V4L2 API in drivers.
>
> Videobuf2 memory management backend is fully modular. This allows custom
> memory management routines for devices and platforms with non-standard
> memory management requirements to be plugged in, without changing the
> high-level buffer management functions and API.
>
> The framework provides:
> - implementations of streaming I/O V4L2 ioctls and file operations
> - high-level video buffer, video queue and state management functions
> - video buffer memory allocation and management
>
> ================================
> Why a new framework?
> ================================
> There have been many discussions in the V4L2 community about the feasibility
> of writing a new framework, as opposed to fixing the existing one. It has been
> agreed though that:
> - videobuf1 has major flaws and an attempt to fix it would end up in rewriting
> most of the code
> - many drivers depend on videobuf1 and since the changes would be major,
> an effort to adapt and test them all would not be realistically possible
>
> Due to the problems with videobuf most new drivers cannot use it. This leads
> to code replication and overcomplicated drivers.
>
> ================================
> What is wrong with videobuf1?
> ================================
> There are many problems with the current videobuf implementation. During a V4L2
> mini-summit in Helsinki in June 2010, two presentations were delivered
> on this topic:
> - Laurent Pinchart "videobuf - the good, the bad and the ugly"
> http://linuxtv.org/downloads/presentations/summit_jun_2010/20100614-v4l2_summit-videobuf.pdf
> - Pawel Osciak "Future of the videobuf framework"
> http://linuxtv.org/downloads/presentations/summit_jun_2010/Videobuf_Helsinki_June2010.pdf
>
> These presentations highlighted many problems with videobuf. The most prominent
> include:
>
> - V4L2 API violations and wrong memory management design
> - it is impossible to pause streaming (buffers are freed on streamoff)
> - VIDIOC_REQBUFS(0) does not free memory
> - it is impossible to reallocate memory with VIDIOC_REQBUFS
> - video memory is allocated on mmap, qbuf or even on page fault,
> freed on unmap, streamoff or explicitly by drivers
> - per-buffer waitqueues
> - not extensible enough and thus not ready for new platforms and uses,
> especially considering embedded multimedia devices
> - very hard to add new memory handling routines and custom memory allocators
> - no or poor support for handling cache coherency, IOMMUs,
> - poor flexibility - only one do-it-all function for handling memory pinning,
> cache, sg-list creation, etc...
> - unused fields, code duplication, vague/inconsistent naming, obscure usage in
> some places...
>
> Many driver authors expressed their frustration with videobuf. Developers
> acknowledge its merits and would like to use it, but due mostly to its
> inflexible memory allocation schemes they are unable to do so.
>
> ================================
> Main goals of the redesign
> ================================
> - correct V4L2 API implementation, fixing videobuf1 problems and shortcomings
> - full separation between queue management and memory management
> - fully flexible, pluggable memory allocators and memory handling routines
> - more specialized driver callbacks, called at different points
> - support for new V4L2 API extensions, such as multi-planar video buffers
>
> ================================
> Driver callbacks
> ================================
> Driver callbacks have been redesigned for symmetry:
> - buf_init - called once, after memory is allocated or after a new USERPTR
> buffer is queued; can be used e.g. to pin pages, verify contiguity, set up
> IOMMU mappings, etc.
> - buf_prepare - called on each QBUF; can be used e.g. for cache sync, copying
> to bounce buffers, etc.
> - buf_finish - called on each DQBUF; can be used e.g. for cache sync, copying
> back from bounce buffers, etc.
> - buf_cleanup - called before freeing/releasing memory; can be used e.g. for
> unmapping memory, etc.
>
> The remaining driver callbacks have been slightly redesigned:
> - queue_negotiate - now incorporates multi-planar extensions; drivers return
> required number of buffers and planes per buffer
> - plane_setup - drivers return plane sizes
> Those two callbacks replace the old buf_setup.
>
> - buf_queue - basically stays the same
>
> ================================
> Memory allocators and handling
> ================================
> Memory handling has been designed to allow more customization than in the
> original videobuf. For this memory allocation ops have been slightly redesigned,
> and have become fully replaceable and an allocator context struct have been
> introduced.
>
> Allocator context is intended to provide memory operations to videobuf and also
> for storing allocator private data, if required, although simpler allocators
> do not have to use this feature. Private data can be added by embedding the
> context struct inside their own structures:
>
> struct vb2_alloc_ctx {
> const struct vb2_mem_ops *mem_ops;
> };
>
> struct vb2_foo_alloc_conf {
> struct vb2_alloc_ctx alloc_ctx;
> /* Allocator private data here */
> };
>
> Moreover, a buffer context structure concept has been introduced. Allocators
> return their own, custom, per-buffer structures on every allocation. This
> structure is then used as a "cookie" and passed to other memory handling
> methods called for its corresponding buffer.
>
> Memory operations, stored in the allocator context, can be replaced if
> needed by drivers on a per-function basis and functions from other allocators
> or drivers can be reused as well. A full list with documentation can be found
> in the videobuf2-core.h file.
>
> It is also possible, although not required, to assign different contexts per
> plane. This may be useful for drivers that need to use different memory types
> for different planes. An example may be a driver that stores video data in the
> first plane, which has to be allocated from a device-accessible memory area,
> and metadata in the second plane, which does not have to be stored in
> a device-accessible memory.
>
> An good example of integrating a more advanced allocator, the recently discussed
> on this list CMA (contiguous memory allocator), can be found in videobuf2-cma.*.
>
> ================================
> Other changes
> ================================
> The changes described above are the main changes in videobuf2. Most of the core
> API has remained the same or very similar, although its implementation has been
> fully rewritten. Some more visible changes include:
>
> - Memory is now properly allocated on REQBUFS and can be freed and reallocated
> there as well.
> - It is now possible to pause and resume streaming with streamon/streamoff,
> without freeing the buffers.
> - V4L2 API-related, userspace-visible metadata, such as inputs, timestamps, etc.
> are no longer stored in videobuf buffer structure, but in an actual
> v4l2_buffer struct (idea borrowed from Laurent Pinchart). I felt that driver
> authors would prefer to use V4L2 API-based structures of videobuf custom
> structures where possible. It also eases copying v4l2_buffer-related data
> from/to userspace.
> - Buffers do not include waitqueues anymore. One, global, per-queue waitqueue
> for done buffers has been introduced instead. Per-buffer waitqueues were not
> very useful and introduced additional complications in code.
> With this, drivers have gained the ability of dequeuing buffers out-of-order
> as well.
> - Buffer states are not handled jointly by both videobuf and driver anymore,
> I felt it was not required and confusing for driver authors
> - Some fields that were less useful have been removed and naming of others
> have been changed to better reflect their function.
> - Other then reqbufs, ioctl implementations have remained almost the same
> and behave in the same way,
>
>
> Please see documentation in videobuf2-core.c and videobuf2-core.h for more
> details and the patch porting vivi to videobuf2 for how to port existing
> drivers to videobuf2.
>
> This is a preliminary version intended for review, but has already been tested
> for multiple drivers and different memory handling implementations. DMA-SG
> implementation is not included yet.
>
> The CMA allocator patches are attached for reference, to show how a more
> complicated allocator can be integrated into the framework.
>
> Any comments will be very much appreciated!
>
> Best regards,
> Pawel Osciak
> Linux Platform Group
> Samsung Poland R&D Center
>
> =======================================================================
>
> Patch summary:
>
> Pawel Osciak (6):
> v4l: add videobuf2 Video for Linux 2 driver framework
> v4l: videobuf2: add generic memory handling routines
> v4l: videobuf2: add vmalloc allocator
> v4l: videobuf2: add DMA coherent allocator
> v4l: vivi: port to videobuf2
> v4l: videobuf2: add CMA allocator
>
> Marek Szyprowski (1):
> v4l: videobuf2: add read() emulator
>
> drivers/media/video/Kconfig | 23 +-
> drivers/media/video/Makefile | 6 +
> drivers/media/video/videobuf2-cma.c | 250 ++++
> drivers/media/video/videobuf2-core.c | 1726 ++++++++++++++++++++++++++
> drivers/media/video/videobuf2-dma-coherent.c | 208 ++++
> drivers/media/video/videobuf2-memops.c | 199 +++
> drivers/media/video/videobuf2-vmalloc.c | 177 +++
> drivers/media/video/vivi.c | 348 +++---
> include/media/videobuf2-cma.h | 25 +
> include/media/videobuf2-core.h | 392 ++++++
> include/media/videobuf2-dma-coherent.h | 21 +
> include/media/videobuf2-memops.h | 31 +
> include/media/videobuf2-vmalloc.h | 16 +
> 13 files changed, 3258 insertions(+), 164 deletions(-)
> create mode 100644 drivers/media/video/videobuf2-cma.c
> create mode 100644 drivers/media/video/videobuf2-core.c
> create mode 100644 drivers/media/video/videobuf2-dma-coherent.c
> create mode 100644 drivers/media/video/videobuf2-memops.c
> create mode 100644 drivers/media/video/videobuf2-vmalloc.c
> create mode 100644 include/media/videobuf2-cma.h
> create mode 100644 include/media/videobuf2-core.h
> create mode 100644 include/media/videobuf2-dma-coherent.h
> create mode 100644 include/media/videobuf2-memops.h
> create mode 100644 include/media/videobuf2-vmalloc.h
>
>
--
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco
^ permalink raw reply
* [U-Boot] [PATCH 1/1] MX5: Unable to get ip address when using dhcp
From: Wolfgang Denk @ 2010-10-20 7:10 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1287555088-3125-1-git-send-email-r64343@freescale.com>
Dear Jason Liu,
In message <1287555088-3125-1-git-send-email-r64343@freescale.com> you wrote:
> Can't get IP address with dhcp due to the dhcp server not
> allow the empty param list request under some network env
>
> Add the advanced DHCP options to fix this issue:
>
> CONFIG_BOOTP_SUBNETMASK
> CONFIG_BOOTP_GATEWAY
> CONFIG_BOOTP_DNS
>
> Signed-off-by: Jason Liu <r64343@freescale.com>
Please test if Gray Remlin's patch "Fix potential empty DHCP Parameter
Request List" fixes the problem for you; see
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/86874
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Life, loathe it or ignore it, you can't like it."
- Marvin the paranoid android
^ permalink raw reply
* Re: [PATCH] V4L/DVB: Add the via framebuffer camera controller driver
From: Hans Verkuil @ 2010-10-20 7:07 UTC (permalink / raw)
To: Jonathan Corbet
Cc: Mauro Carvalho Chehab, Laurent Pinchart, linux-media,
Florian Tobias Schandinat, Daniel Drake
In-Reply-To: <20101019183211.6af74f57@bike.lwn.net>
On Wednesday, October 20, 2010 02:32:11 Jonathan Corbet wrote:
> OK, here's a new version of the patch, done against the V4L tree. Now
> with 100% fewer compiler errors! It took a while to figure out the API
> changes, and I'm not convinced I like them all - the controller driver
> didn't used to have to worry about format details, but now it does -
> but so it goes.
I'm afraid that that change is a sign of V4L growing up and being used in
much more demanding environments like the omap3. While the pixel format and
media bus format have a trivial mapping in this controller driver, things
become a lot more complicated if the same sensor driver were to be used in
e.g. the omap3 SoC.
The sensor driver does not know what the video will look like in memory. It
just passes the video data over a physical bus to some other device. That
other device is what usually determines how the video data it receives over
the bus is DMA-ed into memory. Simple devices just copy the video data almost
directly to memory, but more complex devices can do colorspace transformations,
dword swapping, 4:2:2 to 4:2:0 conversions, scaling, etc., etc.
So what finally arrives in memory may look completely different from what the
sensor supplies.
The consequence of supporting these more complex devices is that it also
makes simple device drivers a bit more complex.
Regards,
Hans
--
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco
^ permalink raw reply
* Re: Deadlock possibly caused by too_many_isolated.
From: KOSAKI Motohiro @ 2010-10-20 7:05 UTC (permalink / raw)
To: Wu Fengguang
Cc: kosaki.motohiro, Torsten Kaiser, Neil Brown, Rik van Riel,
Andrew Morton, KAMEZAWA Hiroyuki, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, Li, Shaohua
In-Reply-To: <20101020055717.GA12752@localhost>
> On Tue, Oct 19, 2010 at 06:06:21PM +0800, Torsten Kaiser wrote:
> > On Tue, Oct 19, 2010 at 10:43 AM, Torsten Kaiser
> > <just.for.lkml@googlemail.com> wrote:
> > > On Tue, Oct 19, 2010 at 1:11 AM, Neil Brown <neilb@suse.de> wrote:
> > >> Yes, thanks for the report.
> > >> This is a real bug exactly as you describe.
> > >>
> > >> This is how I think I will fix it, though it needs a bit of review and
> > >> testing before I can be certain.
> > >> Also I need to check raid10 etc to see if they can suffer too.
> > >>
> > >> If you can test it I would really appreciate it.
> > >
> > > I did test it, but while it seemed to fix the deadlock, the system
> > > still got unusable.
> > > The still running "vmstat 1" showed that the swapout was still
> > > progressing, but at a rate of ~20k sized bursts every 5 to 20 seconds.
> > >
> > > I also tried to additionally add Wu's patch:
> > > --- linux-next.orig/mm/vmscan.c 2010-10-13 12:35:14.000000000 +0800
> > > +++ linux-next/mm/vmscan.c A A A 2010-10-19 00:13:04.000000000 +0800
> > > @@ -1163,6 +1163,13 @@ static int too_many_isolated(struct zone
> > > A A A A A A A isolated = zone_page_state(zone, NR_ISOLATED_ANON);
> > > A A A }
> > >
> > > + A A A /*
> > > + A A A A * GFP_NOIO/GFP_NOFS callers are allowed to isolate more pages, so that
> > > + A A A A * they won't get blocked by normal ones and form circular deadlock.
> > > + A A A A */
> > > + A A A if ((sc->gfp_mask & GFP_IOFS) == GFP_IOFS)
> > > + A A A A A A A inactive >>= 3;
> > > +
> > > A A A return isolated > inactive;
> > >
> > > Either it did help somewhat, or I was more lucky on my second try, but
> > > this time I needed ~5 tries instead of only 2 to get the system mostly
> > > stuck again. On the testrun with Wu's patch the writeout pattern was
> > > more stable, a burst of ~80kb each 20 seconds. But I would suspect
> > > that the size of the burst is rather random.
> > >
> > > I do have a complete SysRq+T dump from the first run, I can send that
> > > to anyone how wants it.
> > > (It's 190k so I don't want not spam it to the list)
> >
> > Is this call trace from the SysRq+T violation the rule to only
> > allocate one bio from bio_alloc() until its submitted?
> >
> > [ 549.700038] Call Trace:
> > [ 549.700038] [<ffffffff81566b54>] schedule_timeout+0x144/0x200
> > [ 549.700038] [<ffffffff81045cd0>] ? process_timeout+0x0/0x10
> > [ 549.700038] [<ffffffff81565e22>] io_schedule_timeout+0x42/0x60
> > [ 549.700038] [<ffffffff81083123>] mempool_alloc+0x163/0x1b0
> > [ 549.700038] [<ffffffff81053560>] ? autoremove_wake_function+0x0/0x40
> > [ 549.700038] [<ffffffff810ea2b9>] bio_alloc_bioset+0x39/0xf0
> > [ 549.700038] [<ffffffff810ea38d>] bio_clone+0x1d/0x50
> > [ 549.700038] [<ffffffff814318ed>] make_request+0x23d/0x850
> > [ 549.700038] [<ffffffff81082e20>] ? mempool_alloc_slab+0x10/0x20
> > [ 549.700038] [<ffffffff81045cd0>] ? process_timeout+0x0/0x10
> > [ 549.700038] [<ffffffff81436e63>] md_make_request+0xc3/0x220
> > [ 549.700038] [<ffffffff81083099>] ? mempool_alloc+0xd9/0x1b0
> > [ 549.700038] [<ffffffff811ec153>] generic_make_request+0x1b3/0x370
> > [ 549.700038] [<ffffffff810ea2d6>] ? bio_alloc_bioset+0x56/0xf0
> > [ 549.700038] [<ffffffff811ec36a>] submit_bio+0x5a/0xd0
> > [ 549.700038] [<ffffffff81080cf5>] ? unlock_page+0x25/0x30
> > [ 549.700038] [<ffffffff810a871e>] swap_writepage+0x7e/0xc0
> > [ 549.700038] [<ffffffff81090d99>] shmem_writepage+0x1c9/0x240
> > [ 549.700038] [<ffffffff8108c9cb>] pageout+0x11b/0x270
> > [ 549.700038] [<ffffffff8108cd78>] shrink_page_list+0x258/0x4d0
> > [ 549.700038] [<ffffffff8108d9e7>] shrink_inactive_list+0x187/0x310
> > [ 549.700038] [<ffffffff8102dcb1>] ? __wake_up_common+0x51/0x80
> > [ 549.700038] [<ffffffff811fc8b2>] ? cpumask_next_and+0x22/0x40
> > [ 549.700038] [<ffffffff8108e1c0>] shrink_zone+0x3e0/0x470
> > [ 549.700038] [<ffffffff8108e797>] try_to_free_pages+0x157/0x410
> > [ 549.700038] [<ffffffff81087c92>] __alloc_pages_nodemask+0x412/0x760
> > [ 549.700038] [<ffffffff810b27d6>] alloc_pages_current+0x76/0xe0
> > [ 549.700038] [<ffffffff810b6dad>] new_slab+0x1fd/0x2a0
> > [ 549.700038] [<ffffffff81045cd0>] ? process_timeout+0x0/0x10
> > [ 549.700038] [<ffffffff810b8721>] __slab_alloc+0x111/0x540
> > [ 549.700038] [<ffffffff81059961>] ? prepare_creds+0x21/0xb0
> > [ 549.700038] [<ffffffff810b92bb>] kmem_cache_alloc+0x9b/0xa0
> > [ 549.700038] [<ffffffff81059961>] prepare_creds+0x21/0xb0
> > [ 549.700038] [<ffffffff8104a919>] sys_setresgid+0x29/0x120
> > [ 549.700038] [<ffffffff8100242b>] system_call_fastpath+0x16/0x1b
> > [ 549.700038] ffff88011e125ea8 0000000000000046 ffff88011e125e08
> > ffffffff81073c59
> > [ 549.700038] 0000000000012780 ffff88011ea905b0 ffff88011ea90808
> > ffff88011e125fd8
> > [ 549.700038] ffff88011ea90810 ffff88011e124010 0000000000012780
> > ffff88011e125fd8
> >
> > swap_writepage() uses get_swap_bio() which uses bio_alloc() to get one
> > bio. That bio is the submitted, but the submit path seems to get into
> > make_request from raid1.c and that allocates a second bio from
> > bio_alloc() via bio_clone().
> >
> > I am seeing this pattern (swap_writepage calling
> > md_make_request/make_request and then getting stuck in mempool_alloc)
> > more than 5 times in the SysRq+T output...
>
> I bet the root cause is the failure of pool->alloc(__GFP_NORETRY)
> inside mempool_alloc(), which can be fixed by this patch.
>
> Thanks,
> Fengguang
> ---
>
> concurrent direct page reclaim problem
>
> __GFP_NORETRY page allocations may fail when there are many concurrent page
> allocating tasks, but not necessary in real short of memory. The root cause
> is, tasks will first run direct page reclaim to free some pages from the LRU
> lists and put them to the per-cpu page lists and the buddy system, and then
> try to get a free page from there. However the free pages reclaimed by this
> task may be consumed by other tasks when the direct reclaim task is able to
> get the free page for itself.
>
> Let's retry it a bit harder.
>
> --- linux-next.orig/mm/page_alloc.c 2010-10-20 13:44:50.000000000 +0800
> +++ linux-next/mm/page_alloc.c 2010-10-20 13:50:54.000000000 +0800
> @@ -1700,7 +1700,7 @@ should_alloc_retry(gfp_t gfp_mask, unsig
> unsigned long pages_reclaimed)
> {
> /* Do not loop if specifically requested */
> - if (gfp_mask & __GFP_NORETRY)
> + if (gfp_mask & __GFP_NORETRY && pages_reclaimed > (1 << (order + 12)))
> return 0;
>
> /*
SLUB usually try high order allocation with __GFP_NORETRY at first. In
other words, It strongly depend on __GFP_NORETRY don't any retry. I'm
worry this...
And, in this case, stucked tasks have PF_MEMALLOC. allocation with PF_MEMALLOC
failure mean this zone have zero memory purely. So, retrying don't solve anything.
And I think the root cause is in another.
bio_clone() use fs_bio_set internally.
struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask)
{
struct bio *b = bio_alloc_bioset(gfp_mask, bio->bi_max_vecs, fs_bio_set);
...
and fs_bio_set is initialized very small pool size.
#define BIO_POOL_SIZE 2
static int __init init_bio(void)
{
..
fs_bio_set = bioset_create(BIO_POOL_SIZE, 0);
So, I think raid1.c need to use their own bioset instead fs_bio_set.
otherwise, bio pool exshost can happen very easily.
But I'm not sure. I'm not IO expert.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: Deadlock possibly caused by too_many_isolated.
From: KOSAKI Motohiro @ 2010-10-20 7:05 UTC (permalink / raw)
To: Wu Fengguang
Cc: kosaki.motohiro, Torsten Kaiser, Neil Brown, Rik van Riel,
Andrew Morton, KAMEZAWA Hiroyuki, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, Li, Shaohua
In-Reply-To: <20101020055717.GA12752@localhost>
> On Tue, Oct 19, 2010 at 06:06:21PM +0800, Torsten Kaiser wrote:
> > On Tue, Oct 19, 2010 at 10:43 AM, Torsten Kaiser
> > <just.for.lkml@googlemail.com> wrote:
> > > On Tue, Oct 19, 2010 at 1:11 AM, Neil Brown <neilb@suse.de> wrote:
> > >> Yes, thanks for the report.
> > >> This is a real bug exactly as you describe.
> > >>
> > >> This is how I think I will fix it, though it needs a bit of review and
> > >> testing before I can be certain.
> > >> Also I need to check raid10 etc to see if they can suffer too.
> > >>
> > >> If you can test it I would really appreciate it.
> > >
> > > I did test it, but while it seemed to fix the deadlock, the system
> > > still got unusable.
> > > The still running "vmstat 1" showed that the swapout was still
> > > progressing, but at a rate of ~20k sized bursts every 5 to 20 seconds.
> > >
> > > I also tried to additionally add Wu's patch:
> > > --- linux-next.orig/mm/vmscan.c 2010-10-13 12:35:14.000000000 +0800
> > > +++ linux-next/mm/vmscan.c 2010-10-19 00:13:04.000000000 +0800
> > > @@ -1163,6 +1163,13 @@ static int too_many_isolated(struct zone
> > > isolated = zone_page_state(zone, NR_ISOLATED_ANON);
> > > }
> > >
> > > + /*
> > > + * GFP_NOIO/GFP_NOFS callers are allowed to isolate more pages, so that
> > > + * they won't get blocked by normal ones and form circular deadlock.
> > > + */
> > > + if ((sc->gfp_mask & GFP_IOFS) == GFP_IOFS)
> > > + inactive >>= 3;
> > > +
> > > return isolated > inactive;
> > >
> > > Either it did help somewhat, or I was more lucky on my second try, but
> > > this time I needed ~5 tries instead of only 2 to get the system mostly
> > > stuck again. On the testrun with Wu's patch the writeout pattern was
> > > more stable, a burst of ~80kb each 20 seconds. But I would suspect
> > > that the size of the burst is rather random.
> > >
> > > I do have a complete SysRq+T dump from the first run, I can send that
> > > to anyone how wants it.
> > > (It's 190k so I don't want not spam it to the list)
> >
> > Is this call trace from the SysRq+T violation the rule to only
> > allocate one bio from bio_alloc() until its submitted?
> >
> > [ 549.700038] Call Trace:
> > [ 549.700038] [<ffffffff81566b54>] schedule_timeout+0x144/0x200
> > [ 549.700038] [<ffffffff81045cd0>] ? process_timeout+0x0/0x10
> > [ 549.700038] [<ffffffff81565e22>] io_schedule_timeout+0x42/0x60
> > [ 549.700038] [<ffffffff81083123>] mempool_alloc+0x163/0x1b0
> > [ 549.700038] [<ffffffff81053560>] ? autoremove_wake_function+0x0/0x40
> > [ 549.700038] [<ffffffff810ea2b9>] bio_alloc_bioset+0x39/0xf0
> > [ 549.700038] [<ffffffff810ea38d>] bio_clone+0x1d/0x50
> > [ 549.700038] [<ffffffff814318ed>] make_request+0x23d/0x850
> > [ 549.700038] [<ffffffff81082e20>] ? mempool_alloc_slab+0x10/0x20
> > [ 549.700038] [<ffffffff81045cd0>] ? process_timeout+0x0/0x10
> > [ 549.700038] [<ffffffff81436e63>] md_make_request+0xc3/0x220
> > [ 549.700038] [<ffffffff81083099>] ? mempool_alloc+0xd9/0x1b0
> > [ 549.700038] [<ffffffff811ec153>] generic_make_request+0x1b3/0x370
> > [ 549.700038] [<ffffffff810ea2d6>] ? bio_alloc_bioset+0x56/0xf0
> > [ 549.700038] [<ffffffff811ec36a>] submit_bio+0x5a/0xd0
> > [ 549.700038] [<ffffffff81080cf5>] ? unlock_page+0x25/0x30
> > [ 549.700038] [<ffffffff810a871e>] swap_writepage+0x7e/0xc0
> > [ 549.700038] [<ffffffff81090d99>] shmem_writepage+0x1c9/0x240
> > [ 549.700038] [<ffffffff8108c9cb>] pageout+0x11b/0x270
> > [ 549.700038] [<ffffffff8108cd78>] shrink_page_list+0x258/0x4d0
> > [ 549.700038] [<ffffffff8108d9e7>] shrink_inactive_list+0x187/0x310
> > [ 549.700038] [<ffffffff8102dcb1>] ? __wake_up_common+0x51/0x80
> > [ 549.700038] [<ffffffff811fc8b2>] ? cpumask_next_and+0x22/0x40
> > [ 549.700038] [<ffffffff8108e1c0>] shrink_zone+0x3e0/0x470
> > [ 549.700038] [<ffffffff8108e797>] try_to_free_pages+0x157/0x410
> > [ 549.700038] [<ffffffff81087c92>] __alloc_pages_nodemask+0x412/0x760
> > [ 549.700038] [<ffffffff810b27d6>] alloc_pages_current+0x76/0xe0
> > [ 549.700038] [<ffffffff810b6dad>] new_slab+0x1fd/0x2a0
> > [ 549.700038] [<ffffffff81045cd0>] ? process_timeout+0x0/0x10
> > [ 549.700038] [<ffffffff810b8721>] __slab_alloc+0x111/0x540
> > [ 549.700038] [<ffffffff81059961>] ? prepare_creds+0x21/0xb0
> > [ 549.700038] [<ffffffff810b92bb>] kmem_cache_alloc+0x9b/0xa0
> > [ 549.700038] [<ffffffff81059961>] prepare_creds+0x21/0xb0
> > [ 549.700038] [<ffffffff8104a919>] sys_setresgid+0x29/0x120
> > [ 549.700038] [<ffffffff8100242b>] system_call_fastpath+0x16/0x1b
> > [ 549.700038] ffff88011e125ea8 0000000000000046 ffff88011e125e08
> > ffffffff81073c59
> > [ 549.700038] 0000000000012780 ffff88011ea905b0 ffff88011ea90808
> > ffff88011e125fd8
> > [ 549.700038] ffff88011ea90810 ffff88011e124010 0000000000012780
> > ffff88011e125fd8
> >
> > swap_writepage() uses get_swap_bio() which uses bio_alloc() to get one
> > bio. That bio is the submitted, but the submit path seems to get into
> > make_request from raid1.c and that allocates a second bio from
> > bio_alloc() via bio_clone().
> >
> > I am seeing this pattern (swap_writepage calling
> > md_make_request/make_request and then getting stuck in mempool_alloc)
> > more than 5 times in the SysRq+T output...
>
> I bet the root cause is the failure of pool->alloc(__GFP_NORETRY)
> inside mempool_alloc(), which can be fixed by this patch.
>
> Thanks,
> Fengguang
> ---
>
> concurrent direct page reclaim problem
>
> __GFP_NORETRY page allocations may fail when there are many concurrent page
> allocating tasks, but not necessary in real short of memory. The root cause
> is, tasks will first run direct page reclaim to free some pages from the LRU
> lists and put them to the per-cpu page lists and the buddy system, and then
> try to get a free page from there. However the free pages reclaimed by this
> task may be consumed by other tasks when the direct reclaim task is able to
> get the free page for itself.
>
> Let's retry it a bit harder.
>
> --- linux-next.orig/mm/page_alloc.c 2010-10-20 13:44:50.000000000 +0800
> +++ linux-next/mm/page_alloc.c 2010-10-20 13:50:54.000000000 +0800
> @@ -1700,7 +1700,7 @@ should_alloc_retry(gfp_t gfp_mask, unsig
> unsigned long pages_reclaimed)
> {
> /* Do not loop if specifically requested */
> - if (gfp_mask & __GFP_NORETRY)
> + if (gfp_mask & __GFP_NORETRY && pages_reclaimed > (1 << (order + 12)))
> return 0;
>
> /*
SLUB usually try high order allocation with __GFP_NORETRY at first. In
other words, It strongly depend on __GFP_NORETRY don't any retry. I'm
worry this...
And, in this case, stucked tasks have PF_MEMALLOC. allocation with PF_MEMALLOC
failure mean this zone have zero memory purely. So, retrying don't solve anything.
And I think the root cause is in another.
bio_clone() use fs_bio_set internally.
struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask)
{
struct bio *b = bio_alloc_bioset(gfp_mask, bio->bi_max_vecs, fs_bio_set);
...
and fs_bio_set is initialized very small pool size.
#define BIO_POOL_SIZE 2
static int __init init_bio(void)
{
..
fs_bio_set = bioset_create(BIO_POOL_SIZE, 0);
So, I think raid1.c need to use their own bioset instead fs_bio_set.
otherwise, bio pool exshost can happen very easily.
But I'm not sure. I'm not IO expert.
^ permalink raw reply
* [PATCH -tip/master] x86-32, mm: Add an initial page table for core bootstrapping
From: Borislav Petkov @ 2010-10-20 7:05 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Borislav Petkov, Daniel Drake, tglx@linutronix.de,
mingo@redhat.com, x86@kernel.org, dilinger@queued.net,
linux-kernel@vger.kernel.org, Roedel, Joerg
In-Reply-To: <4CBE8506.60503@zytor.com>
From: "H. Peter Anvin" <hpa@zytor.com>
Date: Tue, Oct 19, 2010 at 10:58:30PM -0700
> If you could prep something against tip:master we *might* be able to get
> it in... not sure yet (and it partly depends on when Linus decides to
> push the button, of course.)
Here you go, suspend-to-{ram,disk} works, will run it in the next couple
of days just in case.
--
From: Borislav Petkov <bp@alien8.de>
Date: Sat, 28 Aug 2010 15:58:33 +0200
Subject: [PATCH -tip/master] x86-32, mm: Add an initial page table for core bootstrapping
This patch adds an initial page table with low mappings used exclusively
for booting APs/resuming after ACPI suspend/machine restart. After this,
there's no need to add low mappings to swapper_pg_dir and zap them later
or create own swsusp PGD page solely for ACPI sleep needs - we have
initial_page_table for that.
[ v1.1 Fix suspend-to-ram ]
Signed-off-by: Borislav Petkov <bp@alien8.de>
---
arch/x86/include/asm/pgtable_32.h | 2 +-
arch/x86/include/asm/tlbflush.h | 2 -
arch/x86/include/asm/trampoline.h | 3 --
arch/x86/kernel/acpi/sleep.c | 7 ++++-
arch/x86/kernel/head32.c | 1 +
arch/x86/kernel/head_32.S | 55 +++++++++++++++++--------------------
arch/x86/kernel/reboot.c | 10 +-----
arch/x86/kernel/setup.c | 18 +++++++++++-
arch/x86/kernel/smpboot.c | 16 +++--------
arch/x86/kernel/trampoline.c | 16 -----------
arch/x86/mm/init_32.c | 45 ------------------------------
11 files changed, 56 insertions(+), 119 deletions(-)
diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h
index f686f49..8abde9e 100644
--- a/arch/x86/include/asm/pgtable_32.h
+++ b/arch/x86/include/asm/pgtable_32.h
@@ -26,7 +26,7 @@ struct mm_struct;
struct vm_area_struct;
extern pgd_t swapper_pg_dir[1024];
-extern pgd_t trampoline_pg_dir[1024];
+extern pgd_t initial_page_table[1024];
static inline void pgtable_cache_init(void) { }
static inline void check_pgt_cache(void) { }
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
index 7f3eba0..169be89 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -172,6 +172,4 @@ static inline void flush_tlb_kernel_range(unsigned long start,
flush_tlb_all();
}
-extern void zap_low_mappings(bool early);
-
#endif /* _ASM_X86_TLBFLUSH_H */
diff --git a/arch/x86/include/asm/trampoline.h b/arch/x86/include/asm/trampoline.h
index 4dde797..f4500fb 100644
--- a/arch/x86/include/asm/trampoline.h
+++ b/arch/x86/include/asm/trampoline.h
@@ -13,16 +13,13 @@ extern unsigned char *trampoline_base;
extern unsigned long init_rsp;
extern unsigned long initial_code;
-extern unsigned long initial_page_table;
extern unsigned long initial_gs;
#define TRAMPOLINE_SIZE roundup(trampoline_end - trampoline_data, PAGE_SIZE)
extern unsigned long setup_trampoline(void);
-extern void __init setup_trampoline_page_table(void);
extern void __init reserve_trampoline_memory(void);
#else
-static inline void setup_trampoline_page_table(void) {}
static inline void reserve_trampoline_memory(void) {}
#endif /* CONFIG_X86_TRAMPOLINE */
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index e125207..74a8478 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -13,6 +13,11 @@
#include <asm/segment.h>
#include <asm/desc.h>
+#ifdef CONFIG_X86_32
+#include <asm/pgtable.h>
+#include <asm/pgtable_32.h>
+#endif
+
#include "realmode/wakeup.h"
#include "sleep.h"
@@ -91,7 +96,7 @@ int acpi_save_state_mem(void)
#ifndef CONFIG_64BIT
header->pmode_entry = (u32)&wakeup_pmode_return;
- header->pmode_cr3 = (u32)(swsusp_pg_dir - __PAGE_OFFSET);
+ header->pmode_cr3 = (u32)__pa(&initial_page_table);
saved_magic = 0x12345678;
#else /* CONFIG_64BIT */
header->trampoline_segment = setup_trampoline() >> 4;
diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c
index 9a6ca23..7633101 100644
--- a/arch/x86/kernel/head32.c
+++ b/arch/x86/kernel/head32.c
@@ -18,6 +18,7 @@
#include <asm/apic.h>
#include <asm/io_apic.h>
#include <asm/bios_ebda.h>
+#include <asm/tlbflush.h>
static void __init i386_default_early_setup(void)
{
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index fa8c1b8..bcece91 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -183,13 +183,12 @@ default_entry:
#ifdef CONFIG_X86_PAE
/*
- * In PAE mode swapper_pg_dir is statically defined to contain enough
- * entries to cover the VMSPLIT option (that is the top 1, 2 or 3
- * entries). The identity mapping is handled by pointing two PGD
- * entries to the first kernel PMD.
+ * In PAE mode initial_page_table is statically defined to contain
+ * enough entries to cover the VMSPLIT option (that is the top 1, 2 or 3
+ * entries). The identity mapping is handled by pointing two PGD entries
+ * to the first kernel PMD.
*
- * Note the upper half of each PMD or PTE are always zero at
- * this stage.
+ * Note the upper half of each PMD or PTE are always zero at this stage.
*/
#define KPMDS (((-__PAGE_OFFSET) >> 30) & 3) /* Number of kernel PMDs */
@@ -197,7 +196,7 @@ default_entry:
xorl %ebx,%ebx /* %ebx is kept at zero */
movl $pa(__brk_base), %edi
- movl $pa(swapper_pg_pmd), %edx
+ movl $pa(initial_pg_pmd), %edx
movl $PTE_IDENT_ATTR, %eax
10:
leal PDE_IDENT_ATTR(%edi),%ecx /* Create PMD entry */
@@ -226,14 +225,14 @@ default_entry:
movl %eax, pa(max_pfn_mapped)
/* Do early initialization of the fixmap area */
- movl $pa(swapper_pg_fixmap)+PDE_IDENT_ATTR,%eax
- movl %eax,pa(swapper_pg_pmd+0x1000*KPMDS-8)
+ movl $pa(initial_pg_fixmap)+PDE_IDENT_ATTR,%eax
+ movl %eax,pa(initial_pg_pmd+0x1000*KPMDS-8)
#else /* Not PAE */
page_pde_offset = (__PAGE_OFFSET >> 20);
movl $pa(__brk_base), %edi
- movl $pa(swapper_pg_dir), %edx
+ movl $pa(initial_page_table), %edx
movl $PTE_IDENT_ATTR, %eax
10:
leal PDE_IDENT_ATTR(%edi),%ecx /* Create PDE entry */
@@ -257,8 +256,8 @@ page_pde_offset = (__PAGE_OFFSET >> 20);
movl %eax, pa(max_pfn_mapped)
/* Do early initialization of the fixmap area */
- movl $pa(swapper_pg_fixmap)+PDE_IDENT_ATTR,%eax
- movl %eax,pa(swapper_pg_dir+0xffc)
+ movl $pa(initial_pg_fixmap)+PDE_IDENT_ATTR,%eax
+ movl %eax,pa(initial_page_table+0xffc)
#endif
jmp 3f
/*
@@ -334,7 +333,7 @@ ENTRY(startup_32_smp)
/*
* Enable paging
*/
- movl pa(initial_page_table), %eax
+ movl $pa(initial_page_table), %eax
movl %eax,%cr3 /* set the page table pointer.. */
movl %cr0,%eax
orl $X86_CR0_PG,%eax
@@ -614,8 +613,6 @@ ignore_int:
.align 4
ENTRY(initial_code)
.long i386_start_kernel
-ENTRY(initial_page_table)
- .long pa(swapper_pg_dir)
/*
* BSS section
@@ -623,20 +620,18 @@ ENTRY(initial_page_table)
__PAGE_ALIGNED_BSS
.align PAGE_SIZE_asm
#ifdef CONFIG_X86_PAE
-swapper_pg_pmd:
+initial_pg_pmd:
.fill 1024*KPMDS,4,0
#else
-ENTRY(swapper_pg_dir)
+ENTRY(initial_page_table)
.fill 1024,4,0
#endif
-swapper_pg_fixmap:
+initial_pg_fixmap:
.fill 1024,4,0
-#ifdef CONFIG_X86_TRAMPOLINE
-ENTRY(trampoline_pg_dir)
- .fill 1024,4,0
-#endif
ENTRY(empty_zero_page)
.fill 4096,1,0
+ENTRY(swapper_pg_dir)
+ .fill 1024,4,0
/*
* This starts the data section.
@@ -645,20 +640,20 @@ ENTRY(empty_zero_page)
__PAGE_ALIGNED_DATA
/* Page-aligned for the benefit of paravirt? */
.align PAGE_SIZE_asm
-ENTRY(swapper_pg_dir)
- .long pa(swapper_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */
+ENTRY(initial_page_table)
+ .long pa(initial_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */
# if KPMDS == 3
- .long pa(swapper_pg_pmd+PGD_IDENT_ATTR),0
- .long pa(swapper_pg_pmd+PGD_IDENT_ATTR+0x1000),0
- .long pa(swapper_pg_pmd+PGD_IDENT_ATTR+0x2000),0
+ .long pa(initial_pg_pmd+PGD_IDENT_ATTR),0
+ .long pa(initial_pg_pmd+PGD_IDENT_ATTR+0x1000),0
+ .long pa(initial_pg_pmd+PGD_IDENT_ATTR+0x2000),0
# elif KPMDS == 2
.long 0,0
- .long pa(swapper_pg_pmd+PGD_IDENT_ATTR),0
- .long pa(swapper_pg_pmd+PGD_IDENT_ATTR+0x1000),0
+ .long pa(initial_pg_pmd+PGD_IDENT_ATTR),0
+ .long pa(initial_pg_pmd+PGD_IDENT_ATTR+0x1000),0
# elif KPMDS == 1
.long 0,0
.long 0,0
- .long pa(swapper_pg_pmd+PGD_IDENT_ATTR),0
+ .long pa(initial_pg_pmd+PGD_IDENT_ATTR),0
# else
# error "Kernel PMDs should be 1, 2 or 3"
# endif
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 7a4cf14..f7f53dc 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -371,16 +371,10 @@ void machine_real_restart(const unsigned char *code, int length)
CMOS_WRITE(0x00, 0x8f);
spin_unlock(&rtc_lock);
- /* Remap the kernel at virtual address zero, as well as offset zero
- from the kernel segment. This assumes the kernel segment starts at
- virtual address PAGE_OFFSET. */
- memcpy(swapper_pg_dir, swapper_pg_dir + KERNEL_PGD_BOUNDARY,
- sizeof(swapper_pg_dir [0]) * KERNEL_PGD_PTRS);
-
/*
- * Use `swapper_pg_dir' as our page directory.
+ * Switch back to the initial page table.
*/
- load_cr3(swapper_pg_dir);
+ load_cr3(initial_page_table);
/* Write 0x1234 to absolute memory location 0x472. The BIOS reads
this on booting to tell it to "Bypass memory test (also warm
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 44e208e..3df995f 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -700,6 +700,17 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_X86_32
memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
visws_early_detect();
+
+ /*
+ * copy kernel address range established so far and switch
+ * to the proper swapper page table
+ */
+ clone_pgd_range(swapper_pg_dir + KERNEL_PGD_BOUNDARY,
+ initial_page_table + KERNEL_PGD_BOUNDARY,
+ KERNEL_PGD_PTRS);
+
+ load_cr3(swapper_pg_dir);
+ __flush_tlb_all();
#else
printk(KERN_INFO "Command line: %s\n", boot_command_line);
#endif
@@ -985,7 +996,12 @@ void __init setup_arch(char **cmdline_p)
paging_init();
x86_init.paging.pagetable_setup_done(swapper_pg_dir);
- setup_trampoline_page_table();
+#ifdef CONFIG_X86_32
+ /* sync back kernel address range */
+ clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY,
+ swapper_pg_dir + KERNEL_PGD_BOUNDARY,
+ KERNEL_PGD_PTRS);
+#endif
tboot_probe();
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index dfb5089..6af1185 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -299,22 +299,16 @@ notrace static void __cpuinit start_secondary(void *unused)
* fragile that we want to limit the things done here to the
* most necessary things.
*/
+ cpu_init();
+ preempt_disable();
+ smp_callin();
#ifdef CONFIG_X86_32
- /*
- * Switch away from the trampoline page-table
- *
- * Do this before cpu_init() because it needs to access per-cpu
- * data which may not be mapped in the trampoline page-table.
- */
+ /* switch away from the initial page table */
load_cr3(swapper_pg_dir);
__flush_tlb_all();
#endif
- cpu_init();
- preempt_disable();
- smp_callin();
-
/* otherwise gcc will move up smp_processor_id before the cpu_init */
barrier();
/*
@@ -785,7 +779,6 @@ do_rest:
#ifdef CONFIG_X86_32
/* Stack for startup_32 can be just as for start_secondary onwards */
irq_ctx_init(cpu);
- initial_page_table = __pa(&trampoline_pg_dir);
#else
clear_tsk_thread_flag(c_idle.idle, TIF_FORK);
initial_gs = per_cpu_offset(cpu);
@@ -934,7 +927,6 @@ int __cpuinit native_cpu_up(unsigned int cpu)
per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
err = do_boot_cpu(apicid, cpu);
-
if (err) {
pr_debug("do_boot_cpu failed %d\n", err);
return -EIO;
diff --git a/arch/x86/kernel/trampoline.c b/arch/x86/kernel/trampoline.c
index 4c3da56..a375616 100644
--- a/arch/x86/kernel/trampoline.c
+++ b/arch/x86/kernel/trampoline.c
@@ -38,19 +38,3 @@ unsigned long __trampinit setup_trampoline(void)
memcpy(trampoline_base, trampoline_data, TRAMPOLINE_SIZE);
return virt_to_phys(trampoline_base);
}
-
-void __init setup_trampoline_page_table(void)
-{
-#ifdef CONFIG_X86_32
- /* Copy kernel address range */
- clone_pgd_range(trampoline_pg_dir + KERNEL_PGD_BOUNDARY,
- swapper_pg_dir + KERNEL_PGD_BOUNDARY,
- KERNEL_PGD_PTRS);
-
- /* Initialize low mappings */
- clone_pgd_range(trampoline_pg_dir,
- swapper_pg_dir + KERNEL_PGD_BOUNDARY,
- min_t(unsigned long, KERNEL_PGD_PTRS,
- KERNEL_PGD_BOUNDARY));
-#endif
-}
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 5d0a671..0e969f9 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -528,48 +528,6 @@ static void __init pagetable_init(void)
permanent_kmaps_init(pgd_base);
}
-#ifdef CONFIG_ACPI_SLEEP
-/*
- * ACPI suspend needs this for resume, because things like the intel-agp
- * driver might have split up a kernel 4MB mapping.
- */
-char swsusp_pg_dir[PAGE_SIZE]
- __attribute__ ((aligned(PAGE_SIZE)));
-
-static inline void save_pg_dir(void)
-{
- copy_page(swsusp_pg_dir, swapper_pg_dir);
-}
-#else /* !CONFIG_ACPI_SLEEP */
-static inline void save_pg_dir(void)
-{
-}
-#endif /* !CONFIG_ACPI_SLEEP */
-
-void zap_low_mappings(bool early)
-{
- int i;
-
- /*
- * Zap initial low-memory mappings.
- *
- * Note that "pgd_clear()" doesn't do it for
- * us, because pgd_clear() is a no-op on i386.
- */
- for (i = 0; i < KERNEL_PGD_BOUNDARY; i++) {
-#ifdef CONFIG_X86_PAE
- set_pgd(swapper_pg_dir+i, __pgd(1 + __pa(empty_zero_page)));
-#else
- set_pgd(swapper_pg_dir+i, __pgd(0));
-#endif
- }
-
- if (early)
- __flush_tlb();
- else
- flush_tlb_all();
-}
-
pteval_t __supported_pte_mask __read_mostly = ~(_PAGE_NX | _PAGE_GLOBAL | _PAGE_IOMAP);
EXPORT_SYMBOL_GPL(__supported_pte_mask);
@@ -882,9 +840,6 @@ void __init mem_init(void)
if (boot_cpu_data.wp_works_ok < 0)
test_wp_bit();
-
- save_pg_dir();
- zap_low_mappings(true);
}
#ifdef CONFIG_MEMORY_HOTPLUG
--
1.7.2.3
--
Regards/Gruss,
Boris.
^ permalink raw reply related
* Re: trouble compiling udev
From: Ash Charles @ 2010-10-20 7:04 UTC (permalink / raw)
To: openembedded-devel
In-Reply-To: <AANLkTikEpu0yxUXYZvfiRbgiFjnjc+GEAJ=-_x_Mszkp@mail.gmail.com>
On Mon, Oct 4, 2010 at 11:23 AM, Khem Raj <raj.khem@gmail.com> wrote:
> Now gcc 4.5 is default so people will hit it often. Can you commit
> this workaround
> for time being while gcc is being fixed to cure it with reference to
> upstream bug
Hi,
Just a FYI:
I ran into this bug while compiling udev. Regrettably the quick fix
of CFLAGS_append caused my udev to choke on the configure step.
Instead, I applied the bugfix from here
https://code.launchpad.net/~cltang/gcc-linaro/fix-lp-653316 to
gcc-cross-4.5. This was for a armv5te target build.
Udev appears to build nicely now :).
-Ash
^ permalink raw reply
* [U-Boot] facing issue in compiling latest u-boot for P1020RDB(powerpc)
From: Wolfgang Denk @ 2010-10-20 7:05 UTC (permalink / raw)
To: u-boot
In-Reply-To: <D6E175B6D647CC4E897E077D03FD4A5A2594AD@zin33exm22.fsl.freescale.net>
Dear Jain Priyanka-B32167,
In message <D6E175B6D647CC4E897E077D03FD4A5A2594AD@zin33exm22.fsl.freescale.net> you wrote:
> sed version on my machine is GNU 3.02
Please try updating.
Tested with sed-4.2.1 (as Kumar under F13).
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I'm growing older, but not up." - Jimmy Buffett
^ permalink raw reply
* Re: CONFIG_FEC is not good for mpc8xx ethernet?
From: Shawn Jin @ 2010-10-20 7:03 UTC (permalink / raw)
To: tiejun.chen; +Cc: Scott Wood, ppcdev
In-Reply-To: <4CBCFC5D.3010403@windriver.com>
>> On MPC8xx you want drivers/net/fs_enet/mii-fec.c. =A0This is just the
>> MDIO driver; it doesn't handle any particular PHY. =A0I don't know if
>> there is a driver specifically for AM79C874, though the generic PHY
>> support may be good enough.
>
> Maybe.
>
> I can found one related patch for supporting PHY AM79C874 on 2.6.15,
> ------
> http://lists.ozlabs.org/pipermail/linuxppc-embedded/2005-November/021043.=
html
>
> But I don't see that on the latest kernel, and also I don't know the hist=
ory
> completely for that. Maybe its already merged into one generic PHY driver=
but
> I'm not sure.
Thank Scott & Tiejun for valuable information.
The problem for me is that the PHY failed to be probed. The related
error messages are shown below. I even tried the patch Tiejun pointed
out. But that doesn't help. The phy ID read from the bus was all Fs.
FEC MII Bus: probed
mdio_bus fa200e00: error probing PHY at address 0
I don't know if AM79C874 requires any special handling. But from the
comment in mdiobb_cmd() there seems to be something special.
/*
* Send a 32 bit preamble ('1's) with an extra '1' bit for good
* measure. The IEEE spec says this is a PHY optional
* requirement. The AMD 79C874 requires one after power up and
* one after a MII communications error. This means that we are
* doing more preambles than we need, but it is safer and will be
* much more robust.
*/
If there is any network action in u-boot, e.g., tftp or ping, the PHY
can be successfully probed after that. Any hints what went wrong with
the PHY?
Thanks,
-Shawn.
^ permalink raw reply
* Re: [PATCH 2/2] mtd-utils: nanddump: add 64-bit support, utilize libmtd
From: Mike Frysinger @ 2010-10-20 7:01 UTC (permalink / raw)
To: Brian Norris; +Cc: David Woodhouse, linux-mtd, Artem Bityutskiy
In-Reply-To: <1287557125-2672-2-git-send-email-computersforpeace@gmail.com>
On Wed, Oct 20, 2010 at 02:45, Brian Norris wrote:
> -static bool pretty_print = false; // print nice
> -static bool noecc = false; // don't error correct
> -static bool noskipbad = false; // don't skip bad blocks
> -static bool omitoob = false; // omit oob data
> -static unsigned long start_addr; // start address
> -static unsigned long length; // dump length
> -static const char *mtddev; // mtd device name
> -static const char *dumpfile; // dump file name
> -static bool omitbad = false;
> -static bool quiet = false; // suppress diagnostic output
> -static bool canonical = false; // print nice + ascii
> -static bool forcebinary = false; // force printing binary to tty
> +static bool pretty_print = false; // print nice
> +static bool noecc = false; // don't error correct
> +static bool noskipbad = false; // don't skip bad blocks
> +static bool omitoob = false; // omit oob data
> +static unsigned long long start_addr; // start address
> +static unsigned long length; // dump length
> +static const char *mtddev; // mtd device name
> +static const char *dumpfile; // dump file name
> +static bool omitbad = false;
> +static bool quiet = false; // suppress diagnostic output
> +static bool canonical = false; // print nice + ascii
> +static bool forcebinary = false; // force printing binary to tty
only one of these lines are functional. please fold the rest into
your "style fixup" patch.
> @@ -318,7 +318,6 @@ int main(int argc, char * const argv[])
>
> // autoplace ECC ?
> if (old_oobinfo.useecc != MTD_NANDECC_AUTOPLACE) {
> -
> if (ioctl(fd, MEMSETOOBSEL, &autoplace_oobinfo) != 0) {
> perror("MEMSETOOBSEL");
> close(fd);
same here
> @@ -480,7 +479,7 @@ int main(int argc, char * const argv[])
> if (noskipbad)
> continue;
> do {
> - if ((ret = ioctl(fd, MEMGETBADBLOCK, &offs)) < 0) {
> + if ((ret = 0 /*ioctl(fd, MEMGETBADBLOCK, &offs)*/) < 0) {
> perror("ioctl(MEMGETBADBLOCK)");
> goto closeall;
> }
doesnt seem to belong. then again, none of the changes to this file
look like they belong in this patch.
-mike
^ permalink raw reply
* [U-Boot] [PATCH] common/fdt_support.c: Fix compile warnings
From: Wolfgang Denk @ 2010-10-20 7:02 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1286999857-13790-4-git-send-email-john.rigby@linaro.org>
Commit a6bd9e8 "FDT: Add fixup support for multiple banks of memory"
removed code but forgot to remove the variables used by it, resulting
in warnings:
fdt_support.c: In function 'fdt_fixup_memory_banks':
fdt_support.c:399: warning: unused variable 'sizecell'
fdt_support.c:399: warning: unused variable 'addrcell'
Remove the declarations, too.
Signed-off-by: Wolfgang Denk <wd@denx.de>
---
common/fdt_support.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 90e9097..5829afd 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -396,7 +396,6 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
int addr_cell_len, size_cell_len, len;
u8 tmp[banks * 8];
int bank;
- const u32 *addrcell, *sizecell;
err = fdt_check_header(blob);
if (err < 0) {
--
1.7.2.3
^ permalink raw reply related
* [RFC, PATCH 0/5] unify definition of CLOCK_TICK_RATE across different platforms
From: Linus Walleij @ 2010-10-20 7:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20101020045110.GW12979@mail.wantstofly.org>
2010/10/20 Lennert Buytenhek <buytenh@wantstofly.org>:
> One of the things preventing building an ARM multiplatform kernel
> image is the fact that CLOCK_TICK_RATE (and as a consequence, LATCH)
> is defined differently for each ARM platform.
That thing has really annoyed me for some time, so thanks!
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
For all patches touching U300, Ux500.
Yours,
Linus Walleij
^ permalink raw reply
* Re: [PATCH 1/2] mtd-utils: more style fixups
From: Mike Frysinger @ 2010-10-20 6:58 UTC (permalink / raw)
To: Brian Norris; +Cc: David Woodhouse, linux-mtd, Artem Bityutskiy
In-Reply-To: <1287557125-2672-1-git-send-email-computersforpeace@gmail.com>
On Wed, Oct 20, 2010 at 02:45, Brian Norris wrote:
> - ret = ioctl(fd, MTDFILEMODE, (void *) MTD_MODE_RAW);
> + ret = ioctl(fd, MTDFILEMODE, (void *)MTD_MODE_RAW);
i'd just drop the cast completely. ioctl() is a vararg func so there
is no need to tweak the type.
-mike
^ permalink raw reply
* Re: [PATCH] of/mips: Cleanup some include directives/files.
From: Ralf Baechle @ 2010-10-20 6:58 UTC (permalink / raw)
To: David Daney
Cc: linux-mips, devicetree-discuss, grant.likely, linux-kernel,
Dezhong Diao
In-Reply-To: <1287528631-31797-1-git-send-email-ddaney@caviumnetworks.com>
On Tue, Oct 19, 2010 at 03:50:31PM -0700, David Daney wrote:
> The __init directives should go on the definitions of things, not the
> declaration, also __init is meaningless for inline functions, so
> remove it from prom.h. This allows us to get rid of a useless
> #include, but most of the rest of them are useless too, so kill them
> as well.
>
> If of_i2c.c needs irq definitions, it should include linux/irq.h
> directly, not assume indirect inclusion via asm/prom.h.
Grant, I assume you're going to merge this one.
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Ralf
^ permalink raw reply
* [patch 2/2] Staging: sst: add some __user anotations
From: Dan Carpenter @ 2010-10-20 6:58 UTC (permalink / raw)
To: kernel-janitors
This silences all the sparse warnings in intel_sst_app_interface.c.
It was just a matter of adding __user annotations, I didn't find any
real bugs here. Quite a few of these were needed for stuff I added
earlier, sorry about that.
I removed a couple casts to (void *) that caused a warning like:
drivers/staging/intel_sst/intel_sst_app_interface.c:606:27:
warning: cast removes address space of expression
For example sst_drv_ctx->mailbox is already declared as
"void __iomem *mailbox" so casting it to void pointer isn't necessary
and it makes sparse complain because it removes the __user attribute.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/staging/intel_sst/intel_sst_common.h b/drivers/staging/intel_sst/intel_sst_common.h
index 73a98c8..5795567 100644
--- a/drivers/staging/intel_sst/intel_sst_common.h
+++ b/drivers/staging/intel_sst/intel_sst_common.h
@@ -231,8 +231,8 @@ struct stream_info {
spinlock_t pcm_lock;
bool mmapped;
unsigned int sg_index; /* current buf Index */
- unsigned char *cur_ptr; /* Current static bufs */
- struct snd_sst_buf_entry *buf_entry;
+ unsigned char __user *cur_ptr; /* Current static bufs */
+ struct snd_sst_buf_entry __user *buf_entry;
struct sst_block data_blk; /* stream ops block */
struct sst_block ctrl_blk; /* stream control cmd block */
enum snd_sst_buf_type buf_type;
diff --git a/drivers/staging/intel_sst/intel_sst_app_interface.c b/drivers/staging/intel_sst/intel_sst_app_interface.c
index 834bb61..9618c79 100644
--- a/drivers/staging/intel_sst/intel_sst_app_interface.c
+++ b/drivers/staging/intel_sst/intel_sst_app_interface.c
@@ -392,7 +392,7 @@ static int snd_sst_fill_kernel_list(struct stream_info *stream,
{
struct sst_stream_bufs *stream_bufs;
unsigned long index, mmap_len;
- unsigned char *bufp;
+ unsigned char __user *bufp;
unsigned long size, copied_size;
int retval = 0, add_to_list = 0;
static int sent_offset;
@@ -527,9 +527,7 @@ static int snd_sst_copy_userbuf_capture(struct stream_info *stream,
/* copy to user */
list_for_each_entry_safe(entry, _entry,
copy_to_list, node) {
- if (copy_to_user((void *)
- iovec[entry->iov_index].iov_base +
- entry->iov_offset,
+ if (copy_to_user(iovec[entry->iov_index].iov_base + entry->iov_offset,
kbufs->addr + entry->offset,
entry->size)) {
/* Clean up the list and return error */
@@ -605,7 +603,7 @@ static int intel_sst_read_write(unsigned int str_id, char __user *buf,
buf, (int) count, (int) stream->status);
stream->buf_type = SST_BUF_USER_STATIC;
- iovec.iov_base = (void *)buf;
+ iovec.iov_base = buf;
iovec.iov_len = count;
nr_segs = 1;
@@ -878,7 +876,7 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
data->str_id = retval;
str_info = &sst_drv_ctx->streams[retval];
str_info->src = SST_DRV;
- dest = (char *)arg + offsetof(struct snd_sst_params, stream_id);
+ dest = (char __user *)arg + offsetof(struct snd_sst_params, stream_id);
retval = copy_to_user(dest, &retval, sizeof(__u32));
if (retval)
retval = -EFAULT;
@@ -947,7 +945,7 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
pr_debug("sst: id:%d\n, vol:%d, ramp_dur:%d, ramp_type:%d\n",
get_vol.stream_id, get_vol.volume,
get_vol.ramp_duration, get_vol.ramp_type);
- if (copy_to_user((struct snd_sst_vol *)arg,
+ if (copy_to_user((struct snd_sst_vol __user *)arg,
&get_vol, sizeof(get_vol))) {
retval = -EFAULT;
break;
@@ -987,7 +985,7 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
retval = -EIO;
break;
}
- if (copy_to_user((struct snd_sst_get_stream_params *)arg,
+ if (copy_to_user((struct snd_sst_get_stream_params __user *)arg,
&get_params, sizeof(get_params))) {
retval = -EFAULT;
break;
@@ -1032,8 +1030,7 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
break;
}
memcpy_fromio(&tstamp,
- ((void *)(sst_drv_ctx->mailbox + SST_TIME_STAMP)
- +(str_id * sizeof(tstamp))),
+ sst_drv_ctx->mailbox + SST_TIME_STAMP + str_id * sizeof(tstamp),
sizeof(tstamp));
time = tstamp.samples_rendered;
freq = (unsigned long long) tstamp.sampling_frequency;
@@ -1141,11 +1138,11 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
dbufs_local.output_bytes_produced param.output_bytes_produced;
- if (copy_from_user(&ibufs, param.ibufs, sizeof(ibufs))) {
+ if (copy_from_user(&ibufs, (void __user *)param.ibufs, sizeof(ibufs))) {
retval = -EFAULT;
break;
}
- if (copy_from_user(&obufs, param.obufs, sizeof(obufs))) {
+ if (copy_from_user(&obufs, (void __user *)param.obufs, sizeof(obufs))) {
retval = -EFAULT;
break;
}
@@ -1157,7 +1154,7 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
goto free_iobufs;
}
- if (copy_from_user(ibuf_tmp, ibufs.buff_entry,
+ if (copy_from_user(ibuf_tmp, (void __user *)ibufs.buff_entry,
ibufs.entries * sizeof(*ibuf_tmp))) {
retval = -EFAULT;
goto free_iobufs;
@@ -1165,7 +1162,7 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
ibufs.buff_entry = ibuf_tmp;
dbufs_local.ibufs = &ibufs;
- if (copy_from_user(obuf_tmp, obufs.buff_entry,
+ if (copy_from_user(obuf_tmp, (void __user *)obufs.buff_entry,
obufs.entries * sizeof(*obuf_tmp))) {
retval = -EFAULT;
goto free_iobufs;
@@ -1179,7 +1176,7 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
goto free_iobufs;
}
- dest = (char *)arg + offsetof(struct snd_sst_dbufs, input_bytes_consumed);
+ dest = (char __user *)arg + offsetof(struct snd_sst_dbufs, input_bytes_consumed);
if (copy_to_user(dest,
&dbufs_local.input_bytes_consumed,
sizeof(unsigned long long))) {
@@ -1187,7 +1184,7 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
goto free_iobufs;
}
- dest = (char *)arg + offsetof(struct snd_sst_dbufs, input_bytes_consumed);
+ dest = (char __user *)arg + offsetof(struct snd_sst_dbufs, input_bytes_consumed);
if (copy_to_user(dest,
&dbufs_local.output_bytes_produced,
sizeof(unsigned long long))) {
@@ -1210,7 +1207,7 @@ free_iobufs:
break;
case _IOC_NR(SNDRV_SST_STREAM_BYTES_DECODED): {
- unsigned long long *bytes = (unsigned long long *)arg;
+ unsigned long long __user *bytes = (unsigned long long __user *)arg;
struct snd_sst_tstamp tstamp = {0};
pr_debug("sst: STREAM_BYTES_DECODED recieved!\n");
@@ -1219,8 +1216,7 @@ free_iobufs:
break;
}
memcpy_fromio(&tstamp,
- ((void *)(sst_drv_ctx->mailbox + SST_TIME_STAMP)
- +(str_id * sizeof(tstamp))),
+ sst_drv_ctx->mailbox + SST_TIME_STAMP + str_id * sizeof(tstamp),
sizeof(tstamp));
if (copy_to_user(bytes, &tstamp.bytes_processed,
sizeof(*bytes)))
@@ -1243,7 +1239,7 @@ free_iobufs:
kfree(fw_info);
break;
}
- if (copy_to_user((struct snd_sst_dbufs *)arg,
+ if (copy_to_user((struct snd_sst_dbufs __user *)arg,
fw_info, sizeof(*fw_info))) {
kfree(fw_info);
retval = -EFAULT;
^ permalink raw reply related
* [PATCH 04/32] drivers/hwmon/applesmc.c: Use pr_fmt and pr_<level>
From: Joe Perches @ 2010-10-20 6:51 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck; +Cc: Henrik Rydberg, lm-sensors, linux-kernel
In-Reply-To: <cover.1287556800.git.joe@perches.com>
Added #define pr_fmt KBUILD_MODNAME ": " fmt
Converted printks to pr_<level>
Coalesced any long formats
Removed prefixes from formats
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/hwmon/applesmc.c | 60 ++++++++++++++++++++-------------------------
1 files changed, 27 insertions(+), 33 deletions(-)
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index b6598aa..d7a5b75 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -26,6 +26,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/input-polldev.h>
@@ -247,8 +249,7 @@ static int __wait_status(u8 val)
}
}
- printk(KERN_WARNING "applesmc: wait status failed: %x != %x\n",
- val, inb(APPLESMC_CMD_PORT));
+ pr_warn("wait status failed: %x != %x\n", val, inb(APPLESMC_CMD_PORT));
return -EIO;
}
@@ -267,8 +268,7 @@ static int send_command(u8 cmd)
if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == 0x0c)
return 0;
}
- printk(KERN_WARNING "applesmc: command failed: %x -> %x\n",
- cmd, inb(APPLESMC_CMD_PORT));
+ pr_warn("command failed: %x -> %x\n", cmd, inb(APPLESMC_CMD_PORT));
return -EIO;
}
@@ -282,8 +282,8 @@ static int applesmc_read_key(const char* key, u8* buffer, u8 len)
int i;
if (len > APPLESMC_MAX_DATA_LENGTH) {
- printk(KERN_ERR "applesmc_read_key: cannot read more than "
- "%d bytes\n", APPLESMC_MAX_DATA_LENGTH);
+ pr_err("%s(): cannot read more than %d bytes\n",
+ __func__, APPLESMC_MAX_DATA_LENGTH);
return -EINVAL;
}
@@ -325,8 +325,8 @@ static int applesmc_write_key(const char* key, u8* buffer, u8 len)
int i;
if (len > APPLESMC_MAX_DATA_LENGTH) {
- printk(KERN_ERR "applesmc_write_key: cannot write more than "
- "%d bytes\n", APPLESMC_MAX_DATA_LENGTH);
+ pr_err("%s(): cannot write more than %d bytes\n",
+ __func__, APPLESMC_MAX_DATA_LENGTH);
return -EINVAL;
}
@@ -482,7 +482,7 @@ static int applesmc_device_init(void)
msleep(INIT_WAIT_MSECS);
}
- printk(KERN_WARNING "applesmc: failed to init the device\n");
+ pr_warn("failed to init the device\n");
out:
mutex_unlock(&applesmc_lock);
@@ -518,7 +518,7 @@ static int applesmc_probe(struct platform_device *dev)
if (ret)
return ret;
- printk(KERN_INFO "applesmc: device successfully initialized.\n");
+ pr_info("device successfully initialized\n");
return 0;
}
@@ -636,8 +636,7 @@ static ssize_t applesmc_light_show(struct device *dev,
if (ret)
goto out;
data_length = clamp_val(query[0], 0, 10);
- printk(KERN_INFO "applesmc: light sensor data length set to "
- "%d\n", data_length);
+ pr_info("light sensor data length set to %d\n", data_length);
}
ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, buffer, data_length);
@@ -1403,18 +1402,18 @@ static int applesmc_dmi_match(const struct dmi_system_id *id)
{
int i = 0;
struct dmi_match_data* dmi_data = id->driver_data;
- printk(KERN_INFO "applesmc: %s detected:\n", id->ident);
+ pr_info("%s detected:\n", id->ident);
applesmc_accelerometer = dmi_data->accelerometer;
- printk(KERN_INFO "applesmc: - Model %s accelerometer\n",
- applesmc_accelerometer ? "with" : "without");
+ pr_info(" - Model %s accelerometer\n",
+ applesmc_accelerometer ? "with" : "without");
applesmc_light = dmi_data->light;
- printk(KERN_INFO "applesmc: - Model %s light sensors and backlight\n",
- applesmc_light ? "with" : "without");
+ pr_info(" - Model %s light sensors and backlight\n",
+ applesmc_light ? "with" : "without");
applesmc_temperature_set = dmi_data->temperature_set;
while (temperature_sensors_sets[applesmc_temperature_set][i] != NULL)
i++;
- printk(KERN_INFO "applesmc: - Model with %d temperature sensors\n", i);
+ pr_info(" - Model with %d temperature sensors\n", i);
return 1;
}
@@ -1465,7 +1464,7 @@ out_sysfs:
sysfs_remove_group(&pdev->dev.kobj, &accelerometer_attributes_group);
out:
- printk(KERN_WARNING "applesmc: driver init failed (ret=%d)!\n", ret);
+ pr_warn("driver init failed (ret=%d)!\n", ret);
return ret;
}
@@ -1639,7 +1638,7 @@ static int __init applesmc_init(void)
int i;
if (!dmi_check_system(applesmc_whitelist)) {
- printk(KERN_WARNING "applesmc: supported laptop not found!\n");
+ pr_warn("supported laptop not found!\n");
ret = -ENODEV;
goto out;
}
@@ -1673,15 +1672,13 @@ static int __init applesmc_init(void)
/* create fan files */
count = applesmc_get_fan_count();
if (count < 0)
- printk(KERN_ERR "applesmc: Cannot get the number of fans.\n");
+ pr_err("Cannot get the number of fans\n");
else
- printk(KERN_INFO "applesmc: %d fans found.\n", count);
+ pr_info("%d fans found\n", count);
if (count > 4) {
count = 4;
- printk(KERN_WARNING "applesmc: More than 4 fans found,"
- " but at most 4 fans are supported"
- " by the driver.\n");
+ pr_warn("A maximum of 4 fans are supported by this driver\n");
}
while (fans_handled < count) {
@@ -1697,11 +1694,8 @@ static int __init applesmc_init(void)
i++) {
if (temperature_attributes[i] == NULL ||
label_attributes[i] == NULL) {
- printk(KERN_ERR "applesmc: More temperature sensors "
- "in temperature_sensors_sets (at least %i)"
- "than available sysfs files in "
- "temperature_attributes (%i), please report "
- "this bug.\n", i, i-1);
+ pr_err("More temperature sensors in temperature_sensors_sets (at least %i) than available sysfs files in temperature_attributes (%i), please report this bug\n",
+ i, i-1);
goto out_temperature;
}
ret = sysfs_create_file(&pdev->dev.kobj,
@@ -1745,7 +1739,7 @@ static int __init applesmc_init(void)
goto out_light_ledclass;
}
- printk(KERN_INFO "applesmc: driver successfully loaded.\n");
+ pr_info("driver successfully loaded\n");
return 0;
@@ -1778,7 +1772,7 @@ out_driver:
out_region:
release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS);
out:
- printk(KERN_WARNING "applesmc: driver init failed (ret=%d)!\n", ret);
+ pr_warn("driver init failed (ret=%d)!\n", ret);
return ret;
}
@@ -1803,7 +1797,7 @@ static void __exit applesmc_exit(void)
platform_driver_unregister(&applesmc_driver);
release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS);
- printk(KERN_INFO "applesmc: driver unloaded.\n");
+ pr_info("driver unloaded\n");
}
module_init(applesmc_init);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 05/32] drivers/hwmon/asb100.c: Use pr_fmt and pr_<level>
From: Joe Perches @ 2010-10-20 6:51 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck; +Cc: Mark M. Hoffman, lm-sensors, linux-kernel
In-Reply-To: <cover.1287556800.git.joe@perches.com>
Added #define pr_fmt KBUILD_MODNAME ": " fmt
Converted printks to pr_<level>
Coalesced any long formats
Removed prefixes from formats
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/hwmon/asb100.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c
index 7dada55..c02a052 100644
--- a/drivers/hwmon/asb100.c
+++ b/drivers/hwmon/asb100.c
@@ -36,6 +36,8 @@
asb100 7 3 1 4 0x31 0x0694 yes no
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
@@ -701,8 +703,7 @@ static int asb100_detect(struct i2c_client *client,
int val1, val2;
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
- pr_debug("asb100.o: detect failed, "
- "smbus byte data not supported!\n");
+ pr_debug("detect failed, smbus byte data not supported!\n");
return -ENODEV;
}
@@ -715,7 +716,7 @@ static int asb100_detect(struct i2c_client *client,
(((!(val1 & 0x80)) && (val2 != 0x94)) ||
/* Check for ASB100 ID (high byte ) */
((val1 & 0x80) && (val2 != 0x06)))) {
- pr_debug("asb100: detect failed, bad chip id 0x%02x!\n", val2);
+ pr_debug("detect failed, bad chip id 0x%02x!\n", val2);
return -ENODEV;
}
@@ -744,7 +745,7 @@ static int asb100_probe(struct i2c_client *client,
data = kzalloc(sizeof(struct asb100_data), GFP_KERNEL);
if (!data) {
- pr_debug("asb100.o: probe failed, kzalloc failed!\n");
+ pr_debug("probe failed, kzalloc failed!\n");
err = -ENOMEM;
goto ERROR0;
}
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 06/32] drivers/hwmon/asus_atk0110.c: Use pr_fmt and pr_<level>
From: Joe Perches @ 2010-10-20 6:51 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck; +Cc: Luca Tettamanti, lm-sensors, linux-kernel
In-Reply-To: <cover.1287556800.git.joe@perches.com>
Added #define pr_fmt KBUILD_MODNAME ": " fmt
Converted printks to pr_<level>
Coalesced any long formats
Removed prefixes from formats
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/hwmon/asus_atk0110.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c
index 23b8555..2d68cf3 100644
--- a/drivers/hwmon/asus_atk0110.c
+++ b/drivers/hwmon/asus_atk0110.c
@@ -5,6 +5,8 @@
* See COPYING in the top level directory of the kernel tree.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/debugfs.h>
#include <linux/kernel.h>
#include <linux/hwmon.h>
@@ -1414,14 +1416,13 @@ static int __init atk0110_init(void)
/* Make sure it's safe to access the device through ACPI */
if (!acpi_resources_are_enforced()) {
- pr_err("atk: Resources not safely usable due to "
- "acpi_enforce_resources kernel parameter\n");
+ pr_err("Resources not safely usable due to acpi_enforce_resources kernel parameter\n");
return -EBUSY;
}
ret = acpi_bus_register_driver(&atk_driver);
if (ret)
- pr_info("atk: acpi_bus_register_driver failed: %d\n", ret);
+ pr_info("acpi_bus_register_driver failed: %d\n", ret);
return ret;
}
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [U-Boot] facing issue in compiling latest u-boot for P1020RDB(powerpc)
From: Wolfgang Denk @ 2010-10-20 6:57 UTC (permalink / raw)
To: u-boot
In-Reply-To: <D6E175B6D647CC4E897E077D03FD4A5A2594AC@zin33exm22.fsl.freescale.net>
Dear Jain Priyanka-B32167,
In message <D6E175B6D647CC4E897E077D03FD4A5A2594AC@zin33exm22.fsl.freescale.net> you wrote:
>
> I have cloned u-boot code (latest commit-id is
> 1ba91ba23396005ef7b42381cc21f0baf78d0d60) and trying to build P1020RDB.
>
> But it fails.
Hm... please retry current top of tree. I get a number of warnings,
but these are mostly harmless:
-> ./MAKEALL P1020RDB P2020RDB
Configuring for P1020RDB - Board: P1_P2_RDB, Options: P1020RDB
e1000.c: In function 'e1000_transmit':
e1000.c:5028: warning: passing argument 1 of 'virt_to_phys' discards qualifiers from pointer target type
fdt_support.c: In function 'fdt_fixup_memory_banks':
fdt_support.c:399: warning: unused variable 'sizecell'
fdt_support.c:399: warning: unused variable 'addrcell'
text data bss dec hex filename
370540 34448 268116 673104 a4550 ./u-boot
Configuring for P2020RDB - Board: P1_P2_RDB, Options: P2020
e1000.c: In function 'e1000_transmit':
e1000.c:5028: warning: passing argument 1 of 'virt_to_phys' discards qualifiers from pointer target type
fdt_support.c: In function 'fdt_fixup_memory_banks':
fdt_support.c:399: warning: unused variable 'sizecell'
fdt_support.c:399: warning: unused variable 'addrcell'
text data bss dec hex filename
370800 34456 268116 673372 a465c ./u-boot
--------------------- SUMMARY ----------------------------
Boards compiled: 2
Boards with warnings or errors: 2 ( P1020RDB P2020RDB )
----------------------------------------------------------
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
: I've tried (in vi) "g/[a-z]\n[a-z]/s//_/"...but that doesn't
: cut it. Any ideas? (I take it that it may be a two-pass sort of solution).
In the first pass, install perl. :-) Larry Wall <6849@jpl-devvax.JPL.NASA.GOV>
^ permalink raw reply
* [patch 1/2] Staging: sst: user pointers in
From: Dan Carpenter @ 2010-10-20 6:57 UTC (permalink / raw)
To: kernel-janitors
There were some places in intel_sst_mmap_play_capture() that
dereferenced user pointers instead of copying the data to the kernel.
I removed the BUG_ON(!mmap_buf) and BUG_ON(!buf_entry) since those are
never possible in the current code.
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
These apply on top of the three I sent yesterday.
diff --git a/drivers/staging/intel_sst/intel_sst_app_interface.c b/drivers/staging/intel_sst/intel_sst_app_interface.c
index d20724d..0592eb3 100644
--- a/drivers/staging/intel_sst/intel_sst_app_interface.c
+++ b/drivers/staging/intel_sst/intel_sst_app_interface.c
@@ -244,12 +244,12 @@ static int intel_sst_mmap_play_capture(u32 str_id,
int retval, i;
struct stream_info *stream;
struct snd_sst_mmap_buff_entry *buf_entry;
+ struct snd_sst_mmap_buff_entry *tmp_buf;
pr_debug("sst:called for str_id %d\n", str_id);
retval = sst_validate_strid(str_id);
if (retval)
return -EINVAL;
- BUG_ON(!mmap_buf);
stream = &sst_drv_ctx->streams[str_id];
if (stream->mmapped != true)
@@ -262,14 +262,24 @@ static int intel_sst_mmap_play_capture(u32 str_id,
stream->curr_bytes = 0;
stream->cumm_bytes = 0;
+ tmp_buf = kcalloc(mmap_buf->entries, sizeof(*tmp_buf), GFP_KERNEL);
+ if (!tmp_buf)
+ return -ENOMEM;
+ if (copy_from_user(tmp_buf, (void __user *)mmap_buf->buff,
+ mmap_buf->entries * sizeof(*tmp_buf))) {
+ retval = -EFAULT;
+ goto out_free;
+ }
+
pr_debug("sst:new buffers count %d status %d\n",
mmap_buf->entries, stream->status);
- buf_entry = mmap_buf->buff;
+ buf_entry = tmp_buf;
for (i = 0; i < mmap_buf->entries; i++) {
- BUG_ON(!buf_entry);
bufs = kzalloc(sizeof(*bufs), GFP_KERNEL);
- if (!bufs)
- return -ENOMEM;
+ if (!bufs) {
+ retval = -ENOMEM;
+ goto out_free;
+ }
bufs->size = buf_entry->size;
bufs->offset = buf_entry->offset;
bufs->addr = sst_drv_ctx->mmap_mem;
@@ -293,13 +303,15 @@ static int intel_sst_mmap_play_capture(u32 str_id,
if (sst_play_frame(str_id) < 0) {
pr_warn("sst: play frames fail\n");
mutex_unlock(&stream->lock);
- return -EIO;
+ retval = -EIO;
+ goto out_free;
}
} else if (stream->ops = STREAM_OPS_CAPTURE) {
if (sst_capture_frame(str_id) < 0) {
pr_warn("sst: capture frame fail\n");
mutex_unlock(&stream->lock);
- return -EIO;
+ retval = -EIO;
+ goto out_free;
}
}
}
@@ -314,6 +326,9 @@ static int intel_sst_mmap_play_capture(u32 str_id,
if (retval >= 0)
retval = stream->cumm_bytes;
pr_debug("sst:end of play/rec ioctl bytes = %d!!\n", retval);
+
+out_free:
+ kfree(tmp_buf);
return retval;
}
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
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.