Age | Commit message (Collapse) | Author | Files | Lines |
|
The writebufsize concept was introduce by commit
"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents
the maximum amount of data the device writes to the media at a time. This is
an important parameter for UBIFS which is used during recovery and which
basically defines how big a corruption caused by a power cut can be.
Set writebufsize to the flash page size because it is the maximum amount of
data it writes at a time.
Signed-off-by: Artem Bityutskiy <[email protected]>
Acked-by: Stefan Roese <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
The writebufsize concept was introduce by commit
"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents
the maximum amount of data the device writes to the media at a time. This is
an important parameter for UBIFS which is used during recovery and which
basically defines how big a corruption caused by a power cut can be.
Set writebufsize to 4 because this drivers writes at max 4 bytes at a time.
Signed-off-by: Artem Bityutskiy <[email protected]>
Cc: [email protected] [2.6.38+]
Signed-off-by: David Woodhouse <[email protected]>
|
|
The writebufsize concept was introduce by commit
"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents
the maximum amount of data the device writes to the media at a time. This is
an important parameter for UBIFS which is used during recovery and which
basically defines how big a corruption caused by a power cut can be.
Set it to be equivalent to mtd->writesize because this is the maximum amount
of data the driver writes at a time.
Signed-off-by: Artem Bityutskiy <[email protected]>
Acked-by: Robert Jarzmik <[email protected]>
Cc: [email protected] [3.2+]
Signed-off-by: David Woodhouse <[email protected]>
|
|
The writebufsize concept was introduce by commit
"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents
the maximum amount of data the device writes to the media at a time. This is
an important parameter for UBIFS which is used during recovery and which
basically defines how big a corruption caused by a power cut can be.
Set it to be equivalent to mtd->writesize because this is the maximum amount
of data the driver writes at a time.
Signed-off-by: Artem Bityutskiy <[email protected]>
Cc: [email protected] [2.6.38+]
Signed-off-by: David Woodhouse <[email protected]>
|
|
The writebufsize concept was introduce by commit
"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents
the maximum amount of data the device writes to the media at a time. This is
an important parameter for UBIFS which is used during recovery and which
basically defines how big a corruption caused by a power cut can be.
Set it to be equivalent to mtd->writesize because this is the maximum amount
of data the driver writes at a time.
Signed-off-by: Artem Bityutskiy <[email protected]>
Cc: [email protected] [2.6.38+]
Signed-off-by: David Woodhouse <[email protected]>
|
|
The writebufsize concept was introduce by commit
"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents
the maximum amount of data the device writes to the media at a time. This is
an important parameter for UBIFS which is used during recovery and which
basically defines how big a corruption caused by a power cut can be.
Set it to be equivalent to mtd->writesize because this is the maximum amount
of data the driver writes at a time.
Signed-off-by: Artem Bityutskiy <[email protected]>
Cc: [email protected] [2.6.38+]
Signed-off-by: David Woodhouse <[email protected]>
|
|
The writebufsize concept was introduce by commit
"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents
the maximum amount of data the device writes to the media at a time. This is
an important parameter for UBIFS which is used during recovery and which
basically defines how big a corruption caused by a power cut can be.
However, we forgot to set this parameter for block2mtd. Set it to PAGE_SIZE
because this is actually the amount of data we write at a time.
Signed-off-by: Artem Bityutskiy <[email protected]>
Acked-by: Joern Engel <[email protected]>
Cc: [email protected] [2.6.38+]
Signed-off-by: David Woodhouse <[email protected]>
|
|
Gcc complains here:
drivers/mtd/nand/docg4.c: In function ‘probe_docg4’:
drivers/mtd/nand/docg4.c:1277:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘resource_size_t’ [-Wformat]
drivers/mtd/nand/docg4.c:1277:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘resource_size_t’ [-Wformat]
We have a standard way of printing these using a format string
extension.
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Randy Dunlap <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
This has been moved from .options to .bbt_options meanwhile. So, it
currently checks for something totally different (NAND_OWN_BUFFERS) and
decides according to that.
Artem Bityutskiy: the options were moved in
a40f734 mtd: nand: consolidate redundant flash-based BBT flags
Artem Bityutskiy: CCing -stable
Signed-off-by: Wolfram Sang <[email protected]>
Acked-by: Huang Shijie <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Cc: [email protected] [3.2+]
Signed-off-by: David Woodhouse <[email protected]>
|
|
Using UBI on m25p80 can give messages like:
UBI error: io_init: bad write buffer size 0 for 1 min. I/O unit
We need to initialize writebufsize; I think "page_size" is the correct
"bufsize", although I'm not sure. Comments?
Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Cc: [email protected] [2.6.38+]
Signed-off-by: David Woodhouse <[email protected]>
|
|
We don't need to to check for mtd->resume before calling mtd_resume().
mtd_resume() should take care of that.
Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
This patch renames all MTD functions by adding a "_" prefix:
mtd->erase -> mtd->_erase
mtd->read_oob -> mtd->_read_oob
...
The reason is that we are re-working the MTD API and from now on it is
an error to use MTD function pointers directly - we have a corresponding
API call for every pointer. By adding a leading "_" we achieve the following:
1. Make sure we convert every direct pointer users
2. A leading "_" suggests that this interface is internal and it becomes
less likely that people will use them directly
3. Make sure all the out-of-tree modules stop compiling and the owners
spot the big API change and amend them.
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
This patch adds a driver for the M-Sys / Sandisk diskonchip G4 nand flash found
in various smartphones and PDAs, among them the Palm Treo680, HTC Prophet and
Wizard, Toshiba Portege G900, Asus P526, and O2 XDA Zinc. It was tested on the
Treo 680, but should work generically.
Since v3, this patch adds power management functions, a scan of the factory bad
block table during initialization, several fixes, and more extensive testing.
Also, the platform data header file, which only contained partitioning
information, was removed. Command-line partitioning can be used, at least until
an mtd parser is written for the saftl format with which these chips are
shipped.
Signed-off-by: Mike Dunn <[email protected]>
Reviewed-by: Robert Jarzmik <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
Signed-off-by: Stefan Roese <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
This patch converts the drivers in drivers/mtd/* to use the
module_spi_driver() macro which makes the code smaller and a bit simpler.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
As nand_default_block_markbad() is becoming more complex, it helps to
have code appear only in its relevant codepath(s). Here, the calculation
of `ofs' based on NAND_BBT_SCANLASTPAGE is only useful on paths where we
write bad block markers to OOB. We move the condition/calculation closer
to the `write' operation and update the comment to more correctly
describe the operation.
The variable `wr_ofs' is also used to help isolate our calculation of
the "write" offset from the usage of `ofs' to represent the eraseblock
offset. This will become useful when we reorder operations in the next
patch.
This patch should make no functional change.
Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
The mtdoops usage instructions found in Kconfig have been incorrect
since:
commit 2e386e4bac90554887e73d6f342e845185b33fc3
mtd: mtdoops: refactor as a kmsg_dumper
mtdoops no longer uses a console. Now, if you build it into your kernel,
you add something like the following to your command line to select
partition X as your logging partition:
mtdoops.mtddev=X
Anyway, it seems better to leave the documentation out of Kconfig.
Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
/*
* This is here for documentation purposes only - until these people
* submit their machine types. It will be gone January 2005.
*/
It's now seven years after that date, so let's remove this.
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
Commit c4a9f88daf ([MTD] [NOR] fix ctrl-alt-del can't reboot for
intel flash bug) interferes with this work-around, causing MTD to
issue this warning:
Flash device refused suspend due to active operation (state 0)
The commit makes our work-around in the map driver unnecessary, so
let's remove it.
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
Driver must cleanup all held resources during remove. It wasn't
releasing requested memory region.
Signed-off-by: Shiraz Hashim <[email protected]>
Signed-off-by: Stefan Roese <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
SPEAr platforms (spear3xx/spear6xx/spear13xx) provide SMI (Serial Memory
Interface) controller to access serial NOR flash. SMI provides a simple
interface for SPI/serial NOR flashes and has certain inbuilt commands
and features to support these flashes easily. It also makes it possible
to map an address range in order to directly access (read/write) the SNOR
over address bus. This patch intends to provide serial nor driver support
for spear platforms which are accessed through SMI.
Signed-off-by: Shiraz Hashim <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
Signed-off-by: Stefan Roese <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
It seems that we have developed a bad-block-marking "feature" out of
pure laziness:
"We write two bytes per location, so we dont have to mess with 16 bit
access."
It's relatively simple to write a 1 byte at a time on x8 devices and 2
bytes at a time on x16 devices, so let's do it.
Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
nand_block_bad() doesn't check the correct pages when
NAND_BBT_SCAN2NDPAGE is enabled. It should scan both the OOB region of
both the 1st and 2nd page of each block.
Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
Many NAND flash systems (especially those with MLC NAND) cannot be
reliably written twice in a row. For instance, when marking a bad block,
the block may already have data written to it, and so we should attempt
to erase the block before writing a bad block marker to its OOB region.
We can ignore erase failures, since the block may be bad such that it
cannot be erased properly; we still attempt to write zeros to its spare
area.
Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
Add missing iounmap in error handling code, in a case where the function
already preforms iounmap on some other execution path.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression e;
statement S,S1;
int ret;
@@
e = \(ioremap\|ioremap_nocache\)(...)
... when != iounmap(e)
if (<+...e...+>) S
... when any
when != iounmap(e)
*if (...)
{ ... when != iounmap(e)
return ...; }
... when any
iounmap(e);
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
Fix the following build warning:
drivers/mtd/mtdcore.c: In function ‘mtd_release’:
drivers/mtd/mtdcore.c:110: warning: unused variable ‘mtd’
This happens when neither CONFIG_MTD_CHAR nor CONFIG_MTD_CHAR_MODULE are defined.
Signed-off-by: Fabio Estevam <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
Because it is useless to call it if the device is opened in R/O mode, and also
harmful: on CFI NOR flash it may block for long time waiting for erase
operations to complete is another partition with a R/W file-system on this
chip.
Artem Bityutskiy: write commit message, amend the patch to match the latest
tree (we use mtd_sync(), not mtd->sync() nowadays).
Signed-off-by: Alexander Stein <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
Since "length" is a u32, the error handling below didn't work when
fixup_pmc551() returns -ENODEV.
if ((length = fixup_pmc551(PCI_Device)) <= 0)
This patch changes both the type of "length" and the return type of
fixup_pmc551() to int.
Signed-off-by: Xi Wang <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
This allows the mtdoops driver to work on flash chips using the
AMD/Fujitsu compatible command set.
As the code comments note, the locks used throughout the normal code
paths in the driver are ignored, so that the chance of writing out the
kernel's last messages are maximized.
Signed-off-by: Ira W. Snyder <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
|
|
There have some acer laptop have broken _BCM implemenation, the AML
code wrote value to EC register but firmware didn't change brighenss.
Fortunately, the brightness control works on those machines with
vendor mode. So, add quirk table for video backlight vendor mode
and unregister acpi video interface on those machines.
Tested on Acer TravelMate 4750
Cc: Carlos Corbacho <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Corentin Chary <[email protected]>
Cc: Thomas Renninger <[email protected]>
Signed-off-by: Lee, Chun-Yi <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
Clock stretching is not supposed to last long, so asking to be
rescheduled while waiting for the clock line to be released by a slave
makes little sense. Odds are that the clock line will long have been
released when we run again, so we will have lost time and may even
get an SMBus timeout because of this.
So just busy-wait in that case. This also participates in the effort
to make i2c-algo-bit usable in contexts that can't sleep.
Signed-off-by: Jean Delvare <[email protected]>
Cc: Ben Skeggs <[email protected]>
|
|
Signed-off-by: Jean Delvare <[email protected]>
|
|
This patch converts the drivers in drivers/i2c/muxes/* to use the
module_i2c_driver() macro which makes the code smaller and a bit simpler.
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Wolfram Sang <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: Michael Lawnick <[email protected]>
Cc: Ben Dooks <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
|
|
Use usleep_range instead of msleep when waiting for command
completion. Most SMBus commands complete in less than 2 jiffies so
this brings a pleasant performance boost.
Strongly inspired from a similar change by Olivier Sobrie to the
i2c-isch driver.
Signed-off-by: Jean Delvare <[email protected]>
Cc: Olivier Sobrie <[email protected]>
|
|
Add the SMBus controller device IDs for the Intel Lynx Point PCH.
Signed-off-by: Seth Heasley <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
|
|
Generally it is not needed to wait for 1 msec, the SMBus get often ready
in less than 200 usecs.
msleep(1) can wait up to 20 msecs... It has a significant impact when
there is a burst of transactions on the bus.
Signed-off-by: Olivier Sobrie <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
|
|
Direct inclusion of asm/gpio.h has been deprecated for a while now due
to the cross platform gpiolib.
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
|
|
In drivers/platform/x86/amilo-rfkill.c::amilo_rfkill_probe() the call
to dmi_first_match() may fail and return NULL. If it does return NULL,
then we'll be dereferencing a NULL pointer in the rfkill_alloc() call
where we do 'system_id->driver_data' --> KABOOM!
Avoid that problem by testing for a NULL return value from
dmi_first_match() and bailing out if it fails.
I was a bit uncertain about what to return in the failure case. In the
end I settled for -ENXIO as the most logical error to return.
Signed-off-by: Jesper Juhl <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
On these laptops, the ACPI video is not functional, and very unlikely
to be fixed by the vendor. Note that intel_backlight works for some
of these laptops, and the backlight from samsung-laptop always work.
The good news is that newer laptops have functional ACPI video device
and won't end up growing this list.
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
The wireless rfkill should charged by sony-laptop but not acer-wmi.
So, add Sony's SNY5001 acpi device to blacklist in acer-wmi.
Tested on Sony Vaio
Cc: Carlos Corbacho <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Mattia Dongili <[email protected]>
Cc: Dimitris N <[email protected]>
Tested-by: Dimitris N <[email protected]>
Signed-off-by: Lee, Chun-Yi <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
The newer V series bios reports product version as 'Lenovo'
instead of 'ThinkPad'. Recoginze this new string so that
the module can load.
Signed-off-by: Manoj Iyer <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
Tested-by: James Ferguson <[email protected]>
Tested-by: Dennis Chua <[email protected]>
Tested-by: Ike Pan <[email protected]>
Acked-by: Henrique de Moraes Holschuh <[email protected]>
|
|
But we can still do it on other boards, as this might happen
if the backlight driver change when update_bl is called.
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
Even if it's currently unused.
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
Some models work better with different values of wapf, so move the
variable into quriks_entry to make it more easy to give a specific
value to different models.
Based on original patch from AceLan Kao <[email protected]>
Cc: AceLan Kao <[email protected]>
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
Due to some implementation reasons, ASUS ET2012 All-in-One machines
can't report the correct backlight power status, it will always return
1. To track the backlight power status correctly, we have to store the
status by ourselves.
BTW, by the BIOS design, the backlight power will be turn on/off
sequently, no matter what the value of the parameter will be.
More over, the brightness adjustment command will turn on the backlight
power. Those behaviors will make us fail to track the backlight power
status.
For example, While we are trying to turn on the backlight power,
we will send out the brightness adjustment command and then trying to
figure out if we have to turn on the backlight power, then send out
the command. But, the real case is that, the backlight power turns on
while sending the brightness adjustment command, and then we send out
the command to turn on the backlight power, it actually will turn off
the backlight power and the backlight power status we recorded becomes
wrong. So, we have to seperate these two commands by a if statement.
Signed-off-by: AceLan Kao <[email protected]>
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
Some ASUS ET2012E/I All-in-One machines that use a scalar board
to control the brightness, and they only accept brightness up and down
command. So, I introduced a get_scalar_command() function to pass the
command to the scalar board through WMI.
Besides, we have to store the brightness value locally, for we need the
old value to know the brightness value is increasing or decreasing.
BTW, since there is no way to retrieve the actual brightness(it would be
a fixed value), and the max brightness value would be fixed to 1, so we
have to keep passing the brightness up/down command when we reached the
max brightness value or 0.
Signed-off-by: AceLan Kao <[email protected]>
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
This function returns a umode_t (unsigned short) instead of mode_t which
is an unsigned int on some architectures. Cleaning this up silences a
compile warning:
drivers/platform/x86/samsung-laptop.c:1108:2: warning: initialization
from incompatible pointer type [enabled by default]
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
linux/ctype.h is needed for isalnum() to avoid a build error:
drivers/platform/x86/samsung-laptop.c: In function ‘samsung_sabi_diag’:
drivers/platform/x86/samsung-laptop.c:1306: error: implicit declaration of function ‘isalnum’
Signed-off-by: David Rientjes <[email protected]>
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|