pandora-kernel.git
12 years agoarm/dt: tegra devicetree support
Grant Likely [Tue, 19 Jul 2011 23:26:54 +0000 (17:26 -0600)]
arm/dt: tegra devicetree support

Everything required to populate NVIDIA Tegra devices from the device
tree.  This patch adds a new DT_MACHINE_DESC() which matches against
a tegra20 device tree.  So far it only registers the on-chip devices,
but it will be refined in follow on patches to configure clocks and
pin IO from the device tree also.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoarm/versatile: Add device tree support
Grant Likely [Tue, 26 Jul 2011 09:19:06 +0000 (03:19 -0600)]
arm/versatile: Add device tree support

For testing the dt work, define a dt-enabled versatile platform.

This patch adds a new versatile platform for when using the device
tree.  Add platform and amba devices are discovered and registered by
parsing the device tree.  Clocks and initial io mappings are still
configured statically.

This patch still depends on some static platform_data for a few devices
which is passed via the auxdata structure to of_platform_populate(),
but it is a viable starting point until the drivers can get all
configuration data out of the device tree.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agodt/irq: add irq_domain_generate_simple() helper
Grant Likely [Tue, 26 Jul 2011 09:19:06 +0000 (03:19 -0600)]
dt/irq: add irq_domain_generate_simple() helper

irq_domain_generate_simple() is an easy way to generate an irq translation
domain for simple irq controllers.  It assumes a flat 1:1 mapping from
hardware irq number to an offset of the first linux irq number assigned
to the controller

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoirq: add irq_domain translation infrastructure
Grant Likely [Tue, 26 Jul 2011 09:19:06 +0000 (03:19 -0600)]
irq: add irq_domain translation infrastructure

This patch adds irq_domain infrastructure for translating from
hardware irq numbers to linux irqs.  This is particularly important
for architectures adding device tree support because the current
implementation (excluding PowerPC and SPARC) cannot handle
translation for more than a single interrupt controller.  irq_domain
supports device tree translation for any number of interrupt
controllers.

This patch converts x86, Microblaze, ARM and MIPS to use irq_domain
for device tree irq translation.  x86 is untested beyond compiling it,
irq_domain is enabled for MIPS and Microblaze, but the old behaviour is
preserved until the core code is modified to actually register an
irq_domain yet.  On ARM it works and is required for much of the new
ARM device tree board support.

PowerPC has /not/ been converted to use this new infrastructure.  It
is still missing some features before it can replace the virq
infrastructure already in powerpc (see documentation on
irq_domain_map/unmap for details).  Followup patches will add the
missing pieces and migrate PowerPC to use irq_domain.

SPARC has its own method of managing interrupts from the device tree
and is unaffected by this change.

Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agohwmon: (coretemp) Add core/pkg threshold support to Coretemp
Durgadoss R [Tue, 12 Jul 2011 11:07:16 +0000 (07:07 -0400)]
hwmon: (coretemp) Add core/pkg threshold support to Coretemp

This patch adds the core and pkg support to coretemp.
These thresholds can be configured via the sysfs interfaces tempX_max
and tempX_max_hyst. An interrupt is generated when CPU temperature reaches
or crosses above tempX_max OR drops below tempX_max_hyst.

This patch is based on the documentation in IA Manual vol 3A, that can be
downloaded from here:
http://download.intel.com/design/processor/manuals/253668.pdf

Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agohwmon: (lm95241) Add support for LM95231
Guenter Roeck [Tue, 5 Jul 2011 20:31:48 +0000 (13:31 -0700)]
hwmon: (lm95241) Add support for LM95231

LM95231 is fully compatible to LM95241; only necessary change is to add
chip detection.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: LM95245 driver
Alexander Stein [Tue, 28 Jun 2011 15:11:23 +0000 (15:11 +0000)]
hwmon: LM95245 driver

A hwmon driver for the National Semiconductor LM95245 dual temperature
sensors chip.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agohwmon: (lm90) Add support for Philips SA56004
Stijn Devriendt [Mon, 6 Jun 2011 10:40:45 +0000 (10:40 +0000)]
hwmon: (lm90) Add support for Philips SA56004

Add support for Philips SA56004, an LM86 compatible temperature sensor.

Signed-off-by: Stijn Devriendt <sdevrien@cisco.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agohwmon: Driver for NTC Thermistors
Donggeun Kim [Mon, 20 Jun 2011 07:48:19 +0000 (16:48 +0900)]
hwmon: Driver for NTC Thermistors

Add support for NTC Thermistor series. In this release, the
following thermistors are supported: NCP15WB473, NCP18WB473, NCP03WB473,
and NCP15WL333. This driver is based on the datasheet of MURATA.

The driver in the patch does conversion from the raw ADC value
(either voltage or resistence) to temperature. In order to use
voltage values as input, the circuit schematics should be provided
with the platform data. A compensation table for each type of thermistor
is provided for the conversion.

Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: KyungMin Park <kyungmin.park@samsung.com>
Reviewed-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agohwmon: (max1668) Add support for tempX_fault attributes
Guenter Roeck [Fri, 10 Jun 2011 01:05:16 +0000 (18:05 -0700)]
hwmon: (max1668) Add support for tempX_fault attributes

MAX1668 and compatibles have several external temperature sensors, but only a
single FAULT status bit. If a fault occurs, the temperature reported on the
affected sensors is 127 degrees C. Use this knowledge to report fault on
external sensors.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: Driver for MAX1668
David George [Thu, 2 Jun 2011 15:43:45 +0000 (08:43 -0700)]
hwmon: Driver for MAX1668

This patch adds support for MAX1668 and compatible temperature sensors.

Signed-off-by: David George <david.george@ska.ac.za>
[guenter.roeck@ericsson.com: minor cleanup of probe error path]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agotg3: Remove 5719 jumbo frames and TSO blocks
Matt Carlson [Wed, 27 Jul 2011 14:20:54 +0000 (14:20 +0000)]
tg3: Remove 5719 jumbo frames and TSO blocks

The A0 revision of this chip is the only device that requires these
features to be disabled.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Break larger frags into 4k chunks for 5719
Matt Carlson [Wed, 27 Jul 2011 14:20:53 +0000 (14:20 +0000)]
tg3: Break larger frags into 4k chunks for 5719

The 5719 has bug where RDMAs larger than 4k can cause problems.  This
patch works around the problem by dividing larger DMA requests into
something the hardware can handle.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Add tx BD budgeting code
Matt Carlson [Wed, 27 Jul 2011 14:20:52 +0000 (14:20 +0000)]
tg3: Add tx BD budgeting code

As the driver breaks large skb fragments into smaller submissions to the
hardware, there is a new danger that BDs might get exhausted before all
fragments have been mapped.  This patch adds code to make sure tx BDs
aren't oversubscribed and flag the condition if it happens.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Consolidate code that calls tg3_tx_set_bd()
Matt Carlson [Wed, 27 Jul 2011 14:20:51 +0000 (14:20 +0000)]
tg3: Consolidate code that calls tg3_tx_set_bd()

This patch consolidates all code that populates tx BDs into a single
routine.  Setting tx BDs needs to be more carefully controlled to see if
workarounds need to be applied.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Add partial fragment unmapping code
Matt Carlson [Wed, 27 Jul 2011 14:20:50 +0000 (14:20 +0000)]
tg3: Add partial fragment unmapping code

The following patches are going to break skb fragments into smaller
sizes.  This patch attempts to make the change easier to digest by only
addressing the skb teardown portion.

The patch modifies the driver to skip over any BDs that have a flag set
that indicates the BD isn't the beginning of an skb fragment.  Such BDs
were a result of segmentation and do not need a pci_unmap_page() call.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Generalize tg3_skb_error_unmap()
Matt Carlson [Wed, 27 Jul 2011 14:20:49 +0000 (14:20 +0000)]
tg3: Generalize tg3_skb_error_unmap()

In the following patches, unmapping skb fragments will get just as
complicated as mapping them.  This patch generalizes
tg3_skb_error_unmap() and makes it the one-stop-shop for skb unmapping.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Remove short DMA check for 1st fragment
Matt Carlson [Wed, 27 Jul 2011 14:20:48 +0000 (14:20 +0000)]
tg3: Remove short DMA check for 1st fragment

The first fragment of an skb should always be greater than 8 bytes.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Simplify tx bd assignments
Matt Carlson [Wed, 27 Jul 2011 14:20:47 +0000 (14:20 +0000)]
tg3: Simplify tx bd assignments

In the following patches, the process the driver will use to assign skb
fragments to transmit BDs will get more complicated.  To prepare for
that new code, this patch seeks to simplify how transmit BDs are
populated.  It does this by separating the code that assigns the BD
members from the logic that controls how the fields are set.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Reintroduce tg3_tx_ring_info
Matt Carlson [Wed, 27 Jul 2011 14:20:46 +0000 (14:20 +0000)]
tg3: Reintroduce tg3_tx_ring_info

The following patches will require the use of an additional flag in the
ring_info structure.  The use of this flag is tx path specific, so this
patch defines a specialized ring_info structure.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoASIX: Use only 11 bits of header for data size
Marek Vasut [Tue, 26 Jul 2011 16:44:47 +0000 (16:44 +0000)]
ASIX: Use only 11 bits of header for data size

The AX88772B uses only 11 bits of the header for the actual size. The other bits
are used for something else. This causes dmesg full of messages:

asix_rx_fixup() Bad Header Length

This patch trims the check to only 11 bits. I believe on older chips, the
remaining 5 top bits are unused.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoASIX: Simplify condition in rx_fixup()
Marek Vasut [Tue, 26 Jul 2011 16:44:46 +0000 (16:44 +0000)]
ASIX: Simplify condition in rx_fixup()

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoFix cdc-phonet build
Chris Clayton [Tue, 26 Jul 2011 12:20:22 +0000 (12:20 +0000)]
Fix cdc-phonet build

Try to send to correct address this time!

----------  Forwarded Message  ----------

Subject: [PATCH] Fix cdc-phonet build
Date: Saturday 23 Jul 2011
From: Chris Clayton <chris2553@googlemail.com>
To: linux-net@vger.kernel.org

cdc-phonet does not presently build on linux-3.0 because there is no entry for it in
drivers/net/Makefile. This patch adds that entry.

Signed-off-by: Chris Clayton <chris2553@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobonding: reduce noise during init
Andy Gospodarek [Wed, 27 Jul 2011 10:09:26 +0000 (10:09 +0000)]
bonding: reduce noise during init

On Tue, Jul 26, 2011 at 05:40:27PM -0700, Joe Perches wrote:
> On Tue, 2011-07-26 at 17:37 -0700, Jay Vosburgh wrote:
> > Joe Perches <joe@perches.com> wrote:
> > >I'd prefer you don't separate the format string
> > >into multiple pieces.
> > Why not?  To me, it looks easier to read split into sections
> > that don't wrap lines.
>
> Harder to grep for a dmesg and the
> defect rate of these split formats is
> typically higher than single strings
> because of bad spacing between string
> segments.
>

I noticed that you took some time back in late 2009 to 'consolidate' the
split format-strings present in the bonding driver at the time and I've
decided I'm fine to leave them the way they are.  The main point of my
patch was to change the output and I would like to get that included.
Here is my updated patch...

Subject: [PATCH net-next-2.6 v2] bonding: reduce noise during init

Many are using sysfs to configure bonding rather than module options, so
there is no need for bonding to throw this warning in normal cases.

Keep the message around when debugging is enabled as it might be useful
for someone desperate enough to enable debugging, but eliminate it
otherwise.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobonding: fix string comparison errors
Andy Gospodarek [Tue, 26 Jul 2011 11:12:27 +0000 (11:12 +0000)]
bonding: fix string comparison errors

When a bond contains a device where one name is the subset of another
(eth1 and eth10, for example), one cannot properly set the primary
device or the currently active device.

This was reported and based on work by Takuma Umeya.  I also verified
the problem and tested that this fix resolves it.

V2: A few did not like the the current code or my changes, so I
refactored bonding_store_primary and bonding_store_active_slave to be a
bit cleaner, dropped the use of strnicmp since we did not really need
the comparison to be case insensitive, and formatted the input string
from sysfs so a comparison to IFNAMSIZ could be used.

I also discovered an error in bonding_store_active_slave that would
modify bond->primary_slave rather than bond->curr_active_slave before
forcing the bonding driver to choose a new active slave.

V3: Actually sending the proper patch....

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Reported-by: Takuma Umeya <tumeya@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
Neil Horman [Tue, 26 Jul 2011 06:05:38 +0000 (06:05 +0000)]
net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared

After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs.  There are a handful of drivers that violate this assumption of
course, and need to be fixed up.  This patch identifies those drivers, and marks
them as not being able to support the safe transmission of skbs by clearning the
IFF_TX_SKB_SHARING flag in priv_flags

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Karsten Keil <isdn@linux-pingi.de>
CC: "David S. Miller" <davem@davemloft.net>
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: Patrick McHardy <kaber@trash.net>
CC: Krzysztof Halasa <khc@pm.waw.pl>
CC: "John W. Linville" <linville@tuxdriver.com>
CC: Greg Kroah-Hartman <gregkh@suse.de>
CC: Marcel Holtmann <marcel@holtmann.org>
CC: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: add IFF_SKB_TX_SHARED flag to priv_flags
Neil Horman [Tue, 26 Jul 2011 06:05:37 +0000 (06:05 +0000)]
net: add IFF_SKB_TX_SHARED flag to priv_flags

Pktgen attempts to transmit shared skbs to net devices, which can't be used by
some drivers as they keep state information in skbs.  This patch adds a flag
marking drivers as being able to handle shared skbs in their tx path.  Drivers
are defaulted to being unable to do so, but calling ether_setup enables this
flag, as 90% of the drivers calling ether_setup touch real hardware and can
handle shared skbs.  A subsequent patch will audit drivers to ensure that the
flag is set properly

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Jiri Pirko <jpirko@redhat.com>
CC: Robert Olsson <robert.olsson@its.uu.se>
CC: Eric Dumazet <eric.dumazet@gmail.com>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: sock_sendmsg_nosec() is static
Eric Dumazet [Tue, 26 Jul 2011 02:39:41 +0000 (02:39 +0000)]
net: sock_sendmsg_nosec() is static

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Anton Blanchard <anton@samba.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoforcedeth: fix vlans
Jiri Pirko [Tue, 26 Jul 2011 10:19:28 +0000 (10:19 +0000)]
forcedeth: fix vlans

For some reason, when rxaccel is disabled, NV_RX3_VLAN_TAG_PRESENT is
still set and some pseudorandom vids appear. So check for
NETIF_F_HW_VLAN_RX as well. Also set correctly hw_features and set vlan
mode on probe.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agogianfar: fix bug caused by 87c288c6e9aa31720b72e2bc2d665e24e1653c3e
Sebastian Pöhn [Tue, 26 Jul 2011 00:03:13 +0000 (00:03 +0000)]
gianfar: fix bug caused by 87c288c6e9aa31720b72e2bc2d665e24e1653c3e

commit 87c288c6e9aa31720b72e2bc2d665e24e1653c3e "gianfar: do vlan cleanup" has two issues:
# permutation of rx and tx flags
# enabling vlan tag insertion by default (this leads to unusable connections on some configurations)

If VLAN insertion is requested (via ethtool) it will be set at an other point ...

Signed-off-by: Sebastian Poehn <sebastian.poehn@belden.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Thu, 28 Jul 2011 05:18:47 +0000 (22:18 -0700)]
Merge branch 'for-davem' of git://git./linux/kernel/git/linville/wireless-next-2.6

12 years agosparc: Detect and handle UltraSPARC-T3 cpu types.
David S. Miller [Thu, 28 Jul 2011 04:06:16 +0000 (21:06 -0700)]
sparc: Detect and handle UltraSPARC-T3 cpu types.

The cpu compatible string we look for is "SPARC-T3".

As far as memset/memcpy optimizations go, we treat this chip the same
as Niagara-T2/T2+.  Use cache initializing stores for memset, and use
perfetch, FPU block loads, cache initializing stores, and block stores
for copies.

We use the Niagara-T2 perf support, since T3 is a close relative in
this regard.  Later we'll add support for the new events T3 can
report, plus enable T3's new "sample" mode.

For now I haven't added any new ELF hwcap flags.  We probably need
to add a couple, for example:

T2 and T3 both support the population count instruction in hardware.

T3 supports VIS3 instructions, including support (finally) for
partitioned shift.  One can also now move directly between float
and integer registers.

T3 supports instructions meant to help with Galois Field and other HPC
calculations, such as XOR multiply.  Also there are "OP and negate"
instructions, for example "fnmul" which is multiply-and-negate.

T3 recognizes the transactional memory opcodes, however since
transactional memory isn't supported: 1) 'commit' behaves as a NOP and
2) 'chkpt' always branches 3) 'rdcps' returns all zeros and 4) 'wrcps'
behaves as a NOP.

So we'll need about 3 new elf capability flags in the end to represent
all of these things.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosparc: Don't do expensive hypervisor PCR write unless necessary.
David S. Miller [Thu, 28 Jul 2011 03:46:25 +0000 (20:46 -0700)]
sparc: Don't do expensive hypervisor PCR write unless necessary.

The hypervisor call is only necessary if hypervisor events are
being requested.

So if we're not tracking hypervisor events, simply do a direct
register write.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosparc: Add T3 sun4v cpu type and hypervisor group defines.
David S. Miller [Thu, 28 Jul 2011 03:42:51 +0000 (20:42 -0700)]
sparc: Add T3 sun4v cpu type and hypervisor group defines.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosparc: Don't leave sparc_pmu_type NULL on sun4v.
David S. Miller [Thu, 28 Jul 2011 03:25:57 +0000 (20:25 -0700)]
sparc: Don't leave sparc_pmu_type NULL on sun4v.

Otherwise we'll crash in the sparc perf init code.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Thu, 28 Jul 2011 02:26:38 +0000 (19:26 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: (54 commits)
  tpm_nsc: Fix bug when loading multiple TPM drivers
  tpm: Move tpm_tis_reenable_interrupts out of CONFIG_PNP block
  tpm: Fix compilation warning when CONFIG_PNP is not defined
  TOMOYO: Update kernel-doc.
  tpm: Fix a typo
  tpm_tis: Probing function for Intel iTPM bug
  tpm_tis: Fix the probing for interrupts
  tpm_tis: Delay ACPI S3 suspend while the TPM is busy
  tpm_tis: Re-enable interrupts upon (S3) resume
  tpm: Fix display of data in pubek sysfs entry
  tpm_tis: Add timeouts sysfs entry
  tpm: Adjust interface timeouts if they are too small
  tpm: Use interface timeouts returned from the TPM
  tpm_tis: Introduce durations sysfs entry
  tpm: Adjust the durations if they are too small
  tpm: Use durations returned from TPM
  TOMOYO: Enable conditional ACL.
  TOMOYO: Allow using argv[]/envp[] of execve() as conditions.
  TOMOYO: Allow using executable's realpath and symlink's target as conditions.
  TOMOYO: Allow using owner/group etc. of file objects as conditions.
  ...

Fix up trivial conflict in security/tomoyo/realpath.c

12 years agomd/raid10: handle further errors during fix_read_error better.
NeilBrown [Thu, 28 Jul 2011 01:39:25 +0000 (11:39 +1000)]
md/raid10: handle further errors during fix_read_error better.

If we find more read/write errors we should record a bad block before
failing the device.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: Handle read errors during recovery better.
NeilBrown [Thu, 28 Jul 2011 01:39:25 +0000 (11:39 +1000)]
md/raid10: Handle read errors during recovery better.

Currently when we get a read error during recovery, we simply abort
the recovery.

Instead, repeat the read in page-sized blocks.
On successful reads, write to the target.
On read errors, record a bad block on the destination,
and only if that fails do we abort the recovery.

As we now retry reads we need to know where we read from.  This was in
bi_sector but that can be changed during a read attempt.
So store the correct from_addr and to_addr in the r10_bio for later
access.

Signed-off-by: NeilBrown<neilb@suse.de>
12 years agomd/raid10: simplify read error handling during recovery.
NeilBrown [Thu, 28 Jul 2011 01:39:25 +0000 (11:39 +1000)]
md/raid10: simplify read error handling during recovery.

If a read error is detected during recovery the code currently
fails the read device.
This isn't really necessary.  recovery_request_write will signal
a write error to end_sync_write and it will record a write
error on the destination device which will record a bad block
there or kick it from the array.

So just remove this call to do md_error.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: record bad blocks due to write errors during resync/recovery.
NeilBrown [Thu, 28 Jul 2011 01:39:25 +0000 (11:39 +1000)]
md/raid10: record bad blocks due to write errors during resync/recovery.

If we get a write error during resync/recovery don't fail the device
but instead record a bad block.  If that fails we can then fail the
device.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: attempt to fix read errors during resync/check
NeilBrown [Thu, 28 Jul 2011 01:39:25 +0000 (11:39 +1000)]
md/raid10:  attempt to fix read errors during resync/check

We already attempt to fix read errors found during normal IO
and a 'repair' process.
It is best to try to repair them at any time they are found,
so move a test so that during sync and check a read error will
be corrected by over-writing with good data.

If both (all) devices have known bad blocks in the sync section we
won't try to fix even though the bad blocks might not overlap.  That
should be considered later.

Also if we hit a read error during recovery we don't try to fix it.
It would only be possible to fix if there were at least three copies
of data, which is not very common with RAID10.  But it should still
be considered later.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: Handle write errors by updating badblock log.
NeilBrown [Thu, 28 Jul 2011 01:39:24 +0000 (11:39 +1000)]
md/raid10:  Handle write errors by updating badblock log.

When we get a write error (in the data area, not in metadata),
update the badblock log rather than failing the whole device.

As the write may well be many blocks, we trying writing each
block individually and only log the ones which fail.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: clear bad-block record when write succeeds.
NeilBrown [Thu, 28 Jul 2011 01:39:24 +0000 (11:39 +1000)]
md/raid10: clear bad-block record when write succeeds.

If we succeed in writing to a block that was recorded as
being bad, we clear the bad-block record.

This requires some delayed handling as the bad-block-list update has
to happen in process-context.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: avoid writing to known bad blocks on known bad drives.
NeilBrown [Thu, 28 Jul 2011 01:39:24 +0000 (11:39 +1000)]
md/raid10: avoid writing to known bad blocks on known bad drives.

Writing to known bad blocks on drives that have seen a write error
is asking for trouble.  So try to avoid these blocks.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10 record bad blocks as needed during recovery.
NeilBrown [Thu, 28 Jul 2011 01:39:24 +0000 (11:39 +1000)]
md/raid10 record bad blocks as needed during recovery.

When recovering one or more devices, if all the good devices have
bad blocks we should record a bad block on the device being rebuilt.

If this fails, we need to abort the recovery.

To ensure we don't think that we aborted later than we actually did,
we need to move the check for MD_RECOVERY_INTR earlier in md_do_sync,
in particular before mddev->curr_resync is updated.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: avoid reading known bad blocks during resync/recovery.
NeilBrown [Thu, 28 Jul 2011 01:39:24 +0000 (11:39 +1000)]
md/raid10: avoid reading known bad blocks during resync/recovery.

During resync/recovery limit the size of the request to avoid
reading into a bad block that does not start at-or-before the current
read address.

Similarly if there is a bad block at this address, don't allow the
current request to extend beyond the end of that bad block.

Now that we don't ever read from known bad blocks, it is safe to allow
devices with those blocks into the array.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10 - avoid reading from known bad blocks - part 3
NeilBrown [Thu, 28 Jul 2011 01:39:24 +0000 (11:39 +1000)]
md/raid10 - avoid reading from known bad blocks - part 3

When attempting to repair a read error, don't read from
devices with a known bad block.

As we are only reading PAGE_SIZE blocks, we don't try to
narrow down to smaller regions in the hope that only part of this
page is bad - it isn't worth the effort.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: avoid reading from known bad blocks - part 2
NeilBrown [Thu, 28 Jul 2011 01:39:23 +0000 (11:39 +1000)]
md/raid10: avoid reading from known bad blocks - part 2

When redirecting a read error to a different device, we must
again avoid bad blocks and possibly split the request.

Spin_lock typo fixed thanks to Dan Carpenter <error27@gmail.com>

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: avoid reading from known bad blocks - part 1
NeilBrown [Thu, 28 Jul 2011 01:39:23 +0000 (11:39 +1000)]
md/raid10: avoid reading from known bad blocks - part 1

This patch just covers the basic read path:
 1/ read_balance needs to check for badblocks, and return not only
    the chosen slot, but also how many good blocks are available
    there.
 2/ read submission must be ready to issue multiple reads to
    different devices as different bad blocks on different devices
    could mean that a single large read cannot be served by any one
    device, but can still be served by the array.
    This requires keeping count of the number of outstanding requests
    per bio.  This count is stored in 'bi_phys_segments'

On read error we currently just fail the request if another target
cannot handle the whole request.  Next patch refines that a bit.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: Split handle_read_error out from raid10d.
NeilBrown [Thu, 28 Jul 2011 01:39:23 +0000 (11:39 +1000)]
md/raid10: Split handle_read_error out from raid10d.

raid10d() is too big and is about to get bigger, so split
handle_read_error() out as a separate function.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: simplify/reindent some loops.
NeilBrown [Thu, 28 Jul 2011 01:39:23 +0000 (11:39 +1000)]
md/raid10: simplify/reindent some loops.

When a loop ends with a large if, it can be neater to change the
if to invert the condition and just 'continue'.
Then the body of the if can be indented to a lower level.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid5: Clear bad blocks on successful write.
NeilBrown [Thu, 28 Jul 2011 01:39:23 +0000 (11:39 +1000)]
md/raid5: Clear bad blocks on successful write.

On a successful write to a known bad block, flag the sh
so that raid5d can remove the known bad block from the list.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid5. Don't write to known bad block on doubtful devices.
NeilBrown [Thu, 28 Jul 2011 01:39:22 +0000 (11:39 +1000)]
md/raid5.  Don't write to known bad block on doubtful devices.

If a device has seen write errors, don't write to any known
bad blocks on that device.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid5: write errors should be recorded as bad blocks if possible.
NeilBrown [Thu, 28 Jul 2011 01:39:22 +0000 (11:39 +1000)]
md/raid5: write errors should be recorded as bad blocks if possible.

When a write error is detected, don't mark the device as failed
immediately but rather record the fact for handle_stripe to deal with.

Handle_stripe then attempts to record a bad block.  Only if that fails
does the device get marked as faulty.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid5: use bad-block log to improve handling of uncorrectable read errors.
NeilBrown [Thu, 28 Jul 2011 01:39:22 +0000 (11:39 +1000)]
md/raid5: use bad-block log to improve handling of uncorrectable read errors.

If we get an uncorrectable read error - record a bad block rather than
failing the device.
And if these errors (which may be due to known bad blocks) cause
recovery to be impossible, record a bad block on the recovering
devices, or abort the recovery.

As we might abort a recovery without failing a device we need to teach
RAID5 about recovery_disabled handling.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid5: avoid reading from known bad blocks.
NeilBrown [Thu, 28 Jul 2011 01:39:22 +0000 (11:39 +1000)]
md/raid5: avoid reading from known bad blocks.

There are two times that we might read in raid5:
1/ when a read request fits within a chunk on a single
   working device.
   In this case, if there is any bad block in the range of
   the read, we simply fail the cache-bypass read and
   perform the read though the stripe cache.

2/ when reading into the stripe cache.  In this case we
   mark as failed any device which has a bad block in that
   strip (1 page wide).
   Note that we will both avoid reading and avoid writing.
   This is correct (as we will never read from the block, there
   is no point writing), but not optimal (as writing could 'fix'
   the error) - that will be addressed later.

If we have not seen any write errors on the device yet, we treat a bad
block like a recent read error.  This will encourage an attempt to fix
the read error which will either generate a write error, or will
ensure good data is stored there.  We don't yet forget the bad block
in that case.  That comes later.

Now that we honour bad blocks when reading we can allow devices with
bad blocks into the array.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid1: factor several functions out or raid1d()
NeilBrown [Thu, 28 Jul 2011 01:38:13 +0000 (11:38 +1000)]
md/raid1: factor several functions out or raid1d()

raid1d is too big with several deep branches.
So separate them out into their own functions.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
12 years agomd/raid1: improve handling of read failure during recovery.
NeilBrown [Thu, 28 Jul 2011 01:33:42 +0000 (11:33 +1000)]
md/raid1: improve handling of read failure during recovery.

If we cannot read a block from anywhere during recovery, there is
now a better approach than just giving up.
We can record a bad block on each device and keep going - being
careful not to clear the bad block when a write succeeds as it might -
it will be a write of incorrect data.

We have now reached the state where - for raid1 - we only call
md_error if md_set_badblocks has failed.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
12 years agomd/raid1: record badblocks found during resync etc.
NeilBrown [Thu, 28 Jul 2011 01:33:00 +0000 (11:33 +1000)]
md/raid1: record badblocks found during resync etc.

If we find a bad block while writing as part of resync/recovery we
need to report that back to raid1d which must record the bad block,
or fail the device.

Similarly when fixing a read error, a further error should just
record a bad block if possible rather than failing the device.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
12 years agomd/raid1: Handle write errors by updating badblock log.
NeilBrown [Thu, 28 Jul 2011 01:32:41 +0000 (11:32 +1000)]
md/raid1:  Handle write errors by updating badblock log.

When we get a write error (in the data area, not in metadata),
update the badblock log rather than failing the whole device.

As the write may well be many blocks, we trying writing each
block individually and only log the ones which fail.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
12 years agomd/raid1: store behind-write pages in bi_vecs.
NeilBrown [Thu, 28 Jul 2011 01:32:10 +0000 (11:32 +1000)]
md/raid1: store behind-write pages in bi_vecs.

When performing write-behind we allocate pages to store the data
during write.
Previously we just keep a list of pages.  Now we keep a list of
bi_vec which includes offset and size.
This means that the r1bio has complete information to create a new
bio which will be needed for retrying after write errors.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
12 years agomd/raid1: clear bad-block record when write succeeds.
NeilBrown [Thu, 28 Jul 2011 01:31:49 +0000 (11:31 +1000)]
md/raid1: clear bad-block record when write succeeds.

If we succeed in writing to a block that was recorded as
being bad, we clear the bad-block record.

This requires some delayed handling as the bad-block-list update has
to happen in process-context.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
12 years agomd/raid1: avoid writing to known-bad blocks on known-bad drives.
NeilBrown [Thu, 28 Jul 2011 01:31:48 +0000 (11:31 +1000)]
md/raid1: avoid writing to known-bad blocks on known-bad drives.

If we have seen any write error on a drive, then don't write to
any known-bad blocks on that drive.
If necessary, we divide the write request up into pieces just
like we do for reads, so each piece is either all written or
all not written to any given drive.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
12 years agomd: update documentation for md/rdev/state sysfs interface
Namhyung Kim [Thu, 28 Jul 2011 01:31:48 +0000 (11:31 +1000)]
md: update documentation for md/rdev/state sysfs interface

Previous patches in the bad block series extended behavior of
rdev's 'state' interface but lacked documentation update.
Fix it.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd: make it easier to wait for bad blocks to be acknowledged.
NeilBrown [Thu, 28 Jul 2011 01:31:48 +0000 (11:31 +1000)]
md: make it easier to wait for bad blocks to be acknowledged.

It is only safe to choose not to write to a bad block if that bad
block is safely recorded in metadata - i.e. if it has been
'acknowledged'.

If it hasn't we need to wait for the acknowledgement.

We support that using rdev->blocked wait and
md_wait_for_blocked_rdev by introducing a new device flag
'BlockedBadBlock'.

This flag is only advisory.
It is cleared whenever we acknowledge a bad block, so that a waiter
can re-check the particular bad blocks that it is interested it.

It should be set by a caller when they find they need to wait.
This (set after test) is inherently racy, but as
md_wait_for_blocked_rdev already has a timeout, losing the race will
have minimal impact.

When we clear "Blocked" was also clear "BlockedBadBlocks" incase it
was set incorrectly (see above race).

We also modify the way we manage 'Blocked' to fit better with the new
handling of 'BlockedBadBlocks' and to make it consistent between
externally managed and internally managed metadata.   This requires
that each raidXd loop checks if the metadata needs to be written and
triggers a write (md_check_recovery) if needed.  Otherwise a queued
write request might cause raidXd to wait for the metadata to write,
and only that thread can write it.

Before writing metadata, we set FaultRecorded for all devices that
are Faulty, then after writing the metadata we clear Blocked for any
device for which the Fault was certainly Recorded.

The 'faulty' device flag now appears in sysfs if the device is faulty
*or* it has unacknowledged bad blocks.  So user-space which does not
understand bad blocks can continue to function correctly.
User space which does, should not assume a device is faulty until it
sees the 'faulty' flag, and then sees the list of unacknowledged bad
blocks is empty.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd: add 'write_error' flag to component devices.
NeilBrown [Thu, 28 Jul 2011 01:31:48 +0000 (11:31 +1000)]
md: add 'write_error' flag to component devices.

If a device has ever seen a write error, we will want to handle
known-bad-blocks differently.
So create an appropriate state flag and export it via sysfs.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
12 years agomd/raid1: avoid reading known bad blocks during resync
NeilBrown [Thu, 28 Jul 2011 01:31:48 +0000 (11:31 +1000)]
md/raid1: avoid reading known bad blocks during resync

When performing resync/etc, keep the size of the request
small enough that it doesn't overlap any known bad blocks.
Devices with badblocks at the start of the request are completely
excluded.
If there is nowhere to read from due to bad blocks, record
a bad block on each target device.

Now that we never read from known-bad-blocks we can allow devices with
known-bad-blocks into a RAID1.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid1: avoid reading from known bad blocks.
NeilBrown [Thu, 28 Jul 2011 01:31:48 +0000 (11:31 +1000)]
md/raid1: avoid reading from known bad blocks.

Now that we have a bad block list, we should not read from those
blocks.
There are several main parts to this:
  1/ read_balance needs to check for bad blocks, and return not only
     the chosen device, but also how many good blocks are available
     there.
  2/ fix_read_error needs to avoid trying to read from bad blocks.
  3/ read submission must be ready to issue multiple reads to
     different devices as different bad blocks on different devices
     could mean that a single large read cannot be served by any one
     device, but can still be served by the array.
     This requires keeping count of the number of outstanding requests
     per bio.  This count is stored in 'bi_phys_segments'
  4/ retrying a read needs to also be ready to submit a smaller read
     and queue another request for the rest.

This does not yet handle bad blocks when reading to perform resync,
recovery, or check.

'md_trim_bio' will also be used for RAID10, so put it in md.c and
export it.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd: Disable bad blocks and v0.90 metadata.
NeilBrown [Thu, 28 Jul 2011 01:31:47 +0000 (11:31 +1000)]
md: Disable bad blocks and v0.90 metadata.

v0.90 metadata cannot record bad blocks, so when loading metadata
for such a device, set shift to -1.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd: load/store badblock list from v1.x metadata
NeilBrown [Thu, 28 Jul 2011 01:31:47 +0000 (11:31 +1000)]
md: load/store badblock list from v1.x metadata

Space must have been allocated when array was created.
A feature flag is set when the badblock list is non-empty, to
ensure old kernels don't load and trust the whole device.

We only update the on-disk badblocklist when it has changed.
If the badblocklist (or other metadata) is stored on a bad block, we
don't cope very well.

If metadata has no room for bad block, flag bad-blocks as disabled,
and do the same for 0.90 metadata.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd: don't allow arrays to contain devices with bad blocks.
NeilBrown [Thu, 28 Jul 2011 01:31:47 +0000 (11:31 +1000)]
md: don't allow arrays to contain devices with bad blocks.

As no personality understand bad block lists yet, we must
reject any device that is known to contain bad blocks.
As the personalities get taught, these tests can be removed.

This only applies to raid1/raid5/raid10.
For linear/raid0/multipath/faulty the whole concept of bad blocks
doesn't mean anything so there is no point adding the checks.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
12 years agomd: add documentation for bad block log
Namhyung Kim [Thu, 28 Jul 2011 01:31:47 +0000 (11:31 +1000)]
md: add documentation for bad block log

Previous patch in the bad block series added new sysfs interfaces
([unacknowledged_]bad_blocks) for each rdev without documentation.
Add it.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/bad-block-log: add sysfs interface for accessing bad-block-log.
NeilBrown [Thu, 28 Jul 2011 01:31:47 +0000 (11:31 +1000)]
md/bad-block-log: add sysfs interface for accessing bad-block-log.

This can show the log (providing it fits in one page) and
allows bad blocks to be 'acknowledged' meaning that they
have safely been recorded in metadata.

Clearing bad blocks is not allowed via sysfs (except for
code testing).  A bad block can only be cleared when
a write to the block succeeds.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
12 years agomd: beginnings of bad block management.
NeilBrown [Thu, 28 Jul 2011 01:31:46 +0000 (11:31 +1000)]
md: beginnings of bad block management.

This the first step in allowing md to track bad-blocks per-device so
that we can fail individual blocks rather than the whole device.

This patch just adds a data structure for recording bad blocks, with
routines to add, remove, search the list.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs...
Linus Torvalds [Wed, 27 Jul 2011 23:43:52 +0000 (16:43 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mason/btrfs-unstable

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: make sure reserve_metadata_bytes doesn't leak out strange errors
  Btrfs: use the commit_root for reading free_space_inode crcs
  Btrfs: reduce extent_state lock contention for metadata
  Btrfs: remove lockdep magic from btrfs_next_leaf
  Btrfs: make a lockdep class for each root
  Btrfs: switch the btrfs tree locks to reader/writer
  Btrfs: fix deadlock when throttling transactions
  Btrfs: stop using highmem for extent_buffers
  Btrfs: fix BUG_ON() caused by ENOSPC when relocating space
  Btrfs: tag pages for writeback in sync
  Btrfs: fix enospc problems with delalloc
  Btrfs: don't flush delalloc arbitrarily
  Btrfs: use find_or_create_page instead of grab_cache_page
  Btrfs: use a worker thread to do caching
  Btrfs: fix how we merge extent states and deal with cached states
  Btrfs: use the normal checksumming infrastructure for free space cache
  Btrfs: serialize flushers in reserve_metadata_bytes
  Btrfs: do transaction space reservation before joining the transaction
  Btrfs: try to only do one btrfs_search_slot in do_setxattr

12 years agomd: remove suspicious size_of()
NeilBrown [Wed, 27 Jul 2011 21:56:24 +0000 (07:56 +1000)]
md: remove suspicious size_of()

When calling bioset_create we pass the size of the front_pad as
   sizeof(mddev)
which looks suspicious as mddev is a pointer and so it looks like a
common mistake where
   sizeof(*mddev)
was intended.
The size is actually correct as we want to store a pointer in the
front padding of the bios created by the bioset, so make the intent
more explicit by using
   sizeof(mddev_t *)

Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years ago[media] v4l: mt9v032: Fix Bayer pattern
Laurent Pinchart [Sun, 28 Nov 2010 18:07:20 +0000 (15:07 -0300)]
[media] v4l: mt9v032: Fix Bayer pattern

Compute crop rectangle boundaries to ensure a GRBG Bayer pattern.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L: mt9m111: rewrite set_pixfmt
Michael Grzeschik [Tue, 12 Jul 2011 15:39:05 +0000 (12:39 -0300)]
[media] V4L: mt9m111: rewrite set_pixfmt

added new bit offset defines,
more supported BE colour formats
and also support BGR565 swapped pixel formats

removed pixfmt helper functions and option flags
setting the configuration register directly in set_pixfmt

added reg_mask function

reg_mask is basically the same as clearing & setting registers,
but it is more convenient and faster (saves one rw cycle).

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Philipp Wiesner <p.wiesner@phytec.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
[g.liakhovetski@gmx.de: remove Bayer swap, forward-port, rename macros]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear
Michael Grzeschik [Tue, 12 Jul 2011 15:39:03 +0000 (12:39 -0300)]
[media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L: initial driver for ov5642 CMOS sensor
Bastian Hecht [Fri, 24 Jun 2011 10:57:36 +0000 (07:57 -0300)]
[media] V4L: initial driver for ov5642 CMOS sensor

This is an initial driver release for the Omnivision 5642 CMOS sensor.

Signed-off-by: Bastian Hecht <hechtb@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L: sh_mobile_ceu_camera: fix Oops when USERPTR mapping fails
Guennadi Liakhovetski [Mon, 4 Jul 2011 15:15:14 +0000 (12:15 -0300)]
[media] V4L: sh_mobile_ceu_camera: fix Oops when USERPTR mapping fails

If vb2_dma_contig_get_userptr() fails on a videobuffer, driver's
.buf_init() method will not be called and the list will not be
initialised. Trying to remove an uninitialised element from a list leads
to a NULL-dereference.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Tested-by: Bastian Hecht <hechtb@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L: soc-camera: remove soc-camera bus and devices on it
Guennadi Liakhovetski [Fri, 15 Jul 2011 23:03:38 +0000 (20:03 -0300)]
[media] V4L: soc-camera: remove soc-camera bus and devices on it

Now that v4l2 subdevices have got their own device objects, having
one more device in soc-camera clients became redundant and confusing.
This patch removes those devices and the soc-camera bus, they used to
reside on.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L: soc-camera: un-export the soc-camera bus
Guennadi Liakhovetski [Fri, 1 Jul 2011 14:31:35 +0000 (11:31 -0300)]
[media] V4L: soc-camera: un-export the soc-camera bus

The soc-camera bus is now completely local again.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L: sh_mobile_csi2: switch away from using the soc-camera bus notifier
Guennadi Liakhovetski [Fri, 1 Jul 2011 14:19:58 +0000 (11:19 -0300)]
[media] V4L: sh_mobile_csi2: switch away from using the soc-camera bus notifier

This moves us one more step closer to eliminating the soc-camera bus
and devices on it. Besides, as a side effect, CSI-2 runtime PM on
sh-mobile secomes finer grained now: we only have to power on the
interface, when the device nodes are open.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L: add media bus configuration subdev operations
Guennadi Liakhovetski [Fri, 1 Jul 2011 17:31:17 +0000 (14:31 -0300)]
[media] V4L: add media bus configuration subdev operations

Add media bus configuration types and two subdev operations to get
supported mediabus configurations and to set a specific configuration.
Subdevs can support several configurations, e.g., they can send video data
on 1 or several lanes, can be configured to use a specific CSI-2 channel,
in such cases subdevice drivers return bitmasks with all respective bits
set. When a set-configuration operation is called, it has to specify a
non-ambiguous configuration.

Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L: soc-camera: group struct field initialisations together
Guennadi Liakhovetski [Wed, 29 Jun 2011 10:46:40 +0000 (07:46 -0300)]
[media] V4L: soc-camera: group struct field initialisations together

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L: soc-camera: remove now unused soc-camera specific PM hooks
Guennadi Liakhovetski [Wed, 29 Jun 2011 10:43:48 +0000 (07:43 -0300)]
[media] V4L: soc-camera: remove now unused soc-camera specific PM hooks

soc-camera host drivers shall be implementing their PM, using standard
kernel methods, soc-camera specific hooks can die.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L: pxa-camera: switch to using standard PM hooks
Guennadi Liakhovetski [Wed, 29 Jun 2011 14:45:01 +0000 (11:45 -0300)]
[media] V4L: pxa-camera: switch to using standard PM hooks

The pxa-camera driver doesn't need soc-camera specific PM callbacks,
switch it to using the standard PM hooks instead.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] NetUP Dual DVB-T/C CI RF: force card hardware revision by module param
Abylay Ospan [Mon, 18 Jul 2011 07:14:28 +0000 (04:14 -0300)]
[media] NetUP Dual DVB-T/C CI RF: force card hardware revision by module param

Currently available two hardware revision:
0x1 firmware filename: dvb-netup-altera-01.fw
0x4 firmware filename: dvb-netup-altera-04.fw

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] Don't OOPS if videobuf_dvb_get_frontend return NULL
Abylay Ospan [Fri, 15 Jul 2011 18:01:07 +0000 (15:01 -0300)]
[media] Don't OOPS if videobuf_dvb_get_frontend return NULL

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] NetUP Dual DVB-T/C CI RF: load firmware according card revision
Abylay Ospan [Thu, 14 Jul 2011 08:20:29 +0000 (05:20 -0300)]
[media] NetUP Dual DVB-T/C CI RF: load firmware according card revision

Currently available two hardware revision:
0x1 firmware filename: dvb-netup-altera-01.fw
0x4 firmware filename: dvb-netup-altera-04.fw

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] omap3isp: Support configurable HS/VS polarities
Laurent Pinchart [Wed, 25 May 2011 07:16:28 +0000 (04:16 -0300)]
[media] omap3isp: Support configurable HS/VS polarities

Add two fields to the ISP parallel platform data to set the HS and VS
signals polarities.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] OMAP3: RX-51: define vdds_csib regulator supply
Kalle Jokiniemi [Tue, 3 May 2011 10:41:23 +0000 (07:41 -0300)]
[media] OMAP3: RX-51: define vdds_csib regulator supply

The RX-51 uses the CSIb IO complex for camera operation. The
board file is missing definition for the regulator supplying
the CSIb complex, so this is added for better power
management.

Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@nokia.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] OMAP3: ISP: Add regulator control for omap34xx
Kalle Jokiniemi [Tue, 3 May 2011 10:41:22 +0000 (07:41 -0300)]
[media] OMAP3: ISP: Add regulator control for omap34xx

The current omap3isp driver is missing regulator handling
for CSIb complex in omap34xx based devices. This patch
adds a mechanism for this to the omap3isp driver.

Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@nokia.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4l2: OMAP: VOUT: Minor Cleanup, removing the unnecessary code
Amber Jain [Tue, 19 Apr 2011 12:23:51 +0000 (09:23 -0300)]
[media] V4l2: OMAP: VOUT: Minor Cleanup, removing the unnecessary code

Minor changes to remove the unused code from omap_vout driver.

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Samreen <samreen@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L2: OMAP: VOUT: dma map and unmap v4l2 buffers in qbuf and dqbuf
Amber Jain [Thu, 7 Jul 2011 09:03:25 +0000 (06:03 -0300)]
[media] V4L2: OMAP: VOUT: dma map and unmap v4l2 buffers in qbuf and dqbuf

Add support to map the buffer using dma_map_single during qbuf which inturn
calls cache flush and unmap the same during dqbuf. This is done to prevent
the artifacts seen because of cache-coherency issues on OMAP4

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] V4L2: OMAP: VOUT: isr handling extended for DPI and HDMI interface
Amber Jain [Thu, 2 Jun 2011 05:30:10 +0000 (02:30 -0300)]
[media] V4L2: OMAP: VOUT: isr handling extended for DPI and HDMI interface

Extending the omap vout isr handling for:
- HDMI interface.

These are the new interfaces added to OMAP4 DSS.

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] OMAP_VOUT: Create separate file for VRFB related API's
archit taneja [Tue, 14 Jun 2011 06:54:47 +0000 (03:54 -0300)]
[media] OMAP_VOUT: Create separate file for VRFB related API's

Introduce omap_vout_vrfb.c and omap_vout_vrfb.h, for all VRFB related API's,
making OMAP_VOUT driver independent from VRFB. This is required for OMAP4 DSS,
since OMAP4 doesn't have VRFB block.

Added new enum vout_rotation_type and "rotation_type" member to omapvideo_info,
this is initialized based on the arch type in omap_vout_probe. The rotation_type
var is now used to choose between vrfb and non-vrfb calls.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] OMAP_VOUT: CLEANUP: Make rotation related helper functions more descriptive
archit taneja [Tue, 14 Jun 2011 06:54:46 +0000 (03:54 -0300)]
[media] OMAP_VOUT: CLEANUP: Make rotation related helper functions more descriptive

Rename rotation_enabled() and rotate_90_or_270() to is_rotation_enabled()
and is_rotation_90_or_270() to make them more descriptive.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] OMAP_VOUT: CLEANUP: Move generic functions and macros to common files
archit taneja [Tue, 14 Jun 2011 06:54:45 +0000 (03:54 -0300)]
[media] OMAP_VOUT: CLEANUP: Move generic functions and macros to common files

Move the inline functions rotate_90_or_270(), rotation_enabled(), and
calc_rotation() from omap_vout.c to omap_voutdef.h.

Move the independent functions omap_vout_alloc_buffer() and
omap_vout_free_buffer() to omap_voutlib.c.

Remove extern identifier from function definitions in omap_voutlib.h

Add static identifier to functions that are used locally in omap_vout.c

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>