19 Aug, 2011

4 commits

  • Currently, error handling code in this function calls the function
    sata_dwc_port_stop, but this function has essentially no effect if hsdevp
    has not been stored in ap, which is the case throughout this function. The
    only effect is to print a debugging message including ap->print_id.

    The code is rewritten to not call sata_dwc_port_stop, but instead to jump
    to a local label that prints the original error message and the print_id
    information. In the case where hsdevp has been already allocated (but not
    yet stored in ap), this value is freed as well.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @exists@
    local idexpression x;
    statement S,S1;
    expression E;
    identifier fl;
    expression *ptr != NULL;
    @@

    x = \(kmalloc\|kzalloc\|kcalloc\)(...);
    ...
    if (x == NULL) S
    }
    when any
    when != true x == NULL
    x->fl
    ...>
    (
    if (x == NULL) S1
    |
    if (...) { ... when != x
    when forall
    (
    return \(0\|\|ptr\);
    |
    * return ...;
    )
    }
    )
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Jeff Garzik

    Julia Lawall
     
  • Add basic support for pata on iMX. It has been tested only on imx51.
    SDMA support will probably be added later so this version supports only
    PIO.

    v2:
    - enable only when needed IORDY
    - use dev_get_drvdata
    v3:
    - add missing clk_put() calls
    - use platform_get_irq()
    - fix resume code to avoid disabling IORDY on resume
    v4:
    - Remove EXPERIMENTAL and switch to depends on ARCH_MXC
    - Use devm_kzalloc()
    - make clock a must-have
    - Use only 1 ioremap

    Signed-off-by: Arnaud Patard
    Signed-off-by: Jeff Garzik

    Arnaud Patard (Rtp)
     
  • On AVERATEC 3200, pata_via causes memory corruption with ATAPI DMA,
    which often leads to random kernel oops. The cause of the problem is
    not well understood yet and only small subset of machines using the
    controller seem affected. Blacklist ATAPI DMA on the machine.

    Signed-off-by: Tejun Heo
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=11426
    Reported-and-tested-by: Jim Bray
    Cc: Alan Cox
    Cc: stable@kernel.org
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Init 'serror' to silence the following warning:

    drivers/ata/sata_sil.c: In function ‘sil_interrupt’:
    drivers/ata/sata_sil.c:453:14: warning: ‘serror’ may be used uninitialized in
    this function [-Wuninitialized]

    This is not a 'can never happen' but is nonetheless extremely unlikely.
    The easiest and cleanest warning fix is simply to init the var,
    rather than worry about marking the var uninit-ok.

    Signed-off-by: Jeff Garzik

    Jeff Garzik
     

03 Aug, 2011

1 commit

  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (28 commits)
    ACPI: delete stale reference in kernel-parameters.txt
    ACPI: add missing _OSI strings
    ACPI: remove NID_INVAL
    thermal: make THERMAL_HWMON implementation fully internal
    thermal: split hwmon lookup to a separate function
    thermal: hide CONFIG_THERMAL_HWMON
    ACPI print OSI(Linux) warning only once
    ACPI: DMI workaround for Asus A8N-SLI Premium and Asus A8N-SLI DELUX
    ACPI / Battery: propagate sysfs error in acpi_battery_add()
    ACPI / Battery: avoid acpi_battery_add() use-after-free
    ACPI: introduce "acpi_rsdp=" parameter for kdump
    ACPI: constify ops structs
    ACPI: fix CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS
    ACPI: fix 80 char overflow
    ACPI / Battery: Resolve the race condition in the sysfs_remove_battery()
    ACPI / Battery: Add the check before refresh sysfs in the battery_notify()
    ACPI / Battery: Add the hibernation process in the battery_notify()
    ACPI / Battery: Rename acpi_battery_quirks2 with acpi_battery_quirks
    ACPI / Battery: Change 16-bit signed negative battery current into correct value
    ACPI / Battery: Add the power unit macro
    ...

    Linus Torvalds
     

26 Jul, 2011

1 commit


24 Jul, 2011

14 commits

  • Fix kconfig unmet dependency warning:

    warning: (PATA_ARASAN_CF && VIDEO_TIMBERDALE && SND_SOC_SH4_SIU) selects DMA_ENGINE which has unmet direct dependencies (DMADEVICES)

    Signed-off-by: Randy Dunlap
    Cc: Viresh Kumar
    Signed-off-by: Jeff Garzik

    Randy Dunlap
     
  • Compile tested.
    remove unnecessary code that matches this coccinelle pattern
    if (...)
    return ret;
    return ret;

    Signed-off-by: Greg Dietsche
    Signed-off-by: Jeff Garzik

    Greg Dietsche
     
  • Cleanup sff_pio_task_link when a command is cancel while the
    pio_task thread has been scheduled.

    Signed-off-by: Gwendal Grignou
    Acked-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Gwendal Grignou
     
  • This patch adds an additional SATA RAID controller DeviceID for the Intel Panther Point PCH.

    Signed-off-by: Seth Heasley
    Signed-off-by: Jeff Garzik

    Seth Heasley
     
  • The missing comma causes the wrong RAID type to be displayed.
    Introduced by commit 963e4975c6f93c148ca809d986d412201df9af89 three
    years ago, odd that nobody noticed before.

    Signed-off-by: Jean Delvare
    Cc: Jeff Garzik
    Cc: Alan Cox
    Signed-off-by: Jeff Garzik

    Jean Delvare
     
  • Fixed hsdev memleak on sata_dwc_probe() error.
    As dma_dwc_exit() can be called multiple times without sata_dma_regs and
    irq_dma changes, it might lead to double free on sequential
    dma_dwc_exit() calls. So, zero these fields after free calls.

    Signed-off-by: Vasiliy Kulikov
    Signed-off-by: Jeff Garzik

    Vasiliy Kulikov
     
  • Like e65cc194f7628ecaa02462f22f42fb09b50dcd49 this patch enables 64bit DMA
    for the AHCI SATA controller of a board that has the SB600 southbridge. In
    this case though we're enabling 64bit DMA for the Asus M3A motherboard. It
    is a new enough board that all of the BIOS releases since the initial
    release (0301 from 2007-10-22) work correctly with 64bit DMA enabled.

    Signed-off-by: Mark Nelson
    Signed-off-by: Jeff Garzik

    Mark Nelson
     
  • Link resume failure in itself isn't an error condition and may happen
    regularly depending on hardware configuration. Reporting it as
    KERN_ERR makes the condition unnecessarily prominent (e.g. reported
    during boot). Use KERN_WARNING instead.

    Signed-off-by: Tejun Heo
    Reported-by: David Shaw
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • ahci_sb600_softreset was in ahci.c. This function is used
    to fix soft reset failure and renames as ahci_pmp_retry_softreset
    in libahci.c.

    Signed-off-by: Yuan-Hsin Chen
    Signed-off-by: Jeff Garzik

    Yuan-Hsin Chen
     
  • libata EH intentionally left a port frozen if it failed
    ata_eh_reset(). The intention was avoiding continuous loop of resets
    when the controller or attached device is flaky and reporting spurious
    hotplug events. Once port enters this state, it can be recovered with
    manual rescan, which seemed reasonable.

    However, outside of my convoluted test setup, there have been very few
    reports justifying this choice while there have been more cases where
    the automatic freezing of the port after hotplug attempt of a faulty
    device caused confusion and led to unnecessary resets.

    This patch changes the behavior so that the port is thawed after reset
    failure. This change doesn't necessarily solve but makes it easier
    and more intuitive to work around hotplug related problems
    (ie. re-pluggin or power cycling the device) as reported in the
    followings.

    https://bugzilla.kernel.org/show_bug.cgi?id=34712
    http://thread.gmane.org/gmane.linux.kernel/1123265/focus=49548

    Signed-off-by: Tejun Heo
    Reported-by: Reartes Guillermo
    Reported-by: Bruce Stenning
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Use normal debugging path for dynamic debug capability.

    Convert dev_printk(KERN_DEBUG to dev_dbg(

    Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     
  • Use a single mechanism to show driver version.
    Reduces text a tiny bit too.

    Remove uses of static int printed_version
    Add and use ata_print_version(const struct device *, const char *ver)
    and ata_print_version_once.

    $ size drivers/ata/built-in.*
    text data bss dec hex filename
    544969 73893 116584 735446 b38d6 drivers/ata/built-in.allyesconfig.ata.o
    543870 73893 116592 734355 b34ad drivers/ata/built-in.allyesconfig.print_once.o
    141328 14689 4220 160237 271ed drivers/ata/built-in.defconfig.ata.o
    141212 14689 4220 160121 27179 drivers/ata/built-in.defconfig.print_once.o

    Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     
  • Saves text by removing nearly duplicated text format strings by
    creating ata__printk functions and printf extension %pV.

    ata defconfig size shrinks ~5% (~8KB), allyesconfig ~2.5% (~13KB)

    Format string duplication comes from:

    #define ata_link_printk(link, lv, fmt, args...) do { \
    if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \
    printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \
    (link)->pmp , ##args); \
    else \
    printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \
    } while(0)

    Coalesce long formats.

    $ size drivers/ata/built-in.*
    text data bss dec hex filename
    544969 73893 116584 735446 b38d6 drivers/ata/built-in.allyesconfig.ata.o
    558429 73893 117864 750186 b726a drivers/ata/built-in.allyesconfig.dev_level.o
    141328 14689 4220 160237 271ed drivers/ata/built-in.defconfig.ata.o
    149567 14689 4220 168476 2921c drivers/ata/built-in.defconfig.dev_level.o

    Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     
  • Saves a bit of text as the call takes fewer args.

    Coalesce a few formats.
    Convert a few bare printks to pr_cont.

    $ size drivers/ata/built-in.o*
    text data bss dec hex filename
    558429 73893 117864 750186 b726a drivers/ata/built-in.o.allyesconfig.new
    559574 73893 117888 751355 b76fb drivers/ata/built-in.o.allyesconfig.old
    149567 14689 4220 168476 2921c drivers/ata/built-in.o.defconfig.new
    149851 14689 4220 168760 29338 drivers/ata/built-in.o.defconfig.old

    Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     

17 Jul, 2011

1 commit

  • Structs battery_file, acpi_dock_ops, file_operations,
    thermal_cooling_device_ops, thermal_zone_device_ops, kernel_param_ops
    are not changed in runtime. It is safe to make them const.
    register_hotplug_dock_device() was altered to take const "ops" argument
    to respect acpi_dock_ops' const notion.

    Signed-off-by: Vasiliy Kulikov
    Acked-by: Jeff Garzik
    Signed-off-by: Len Brown

    Vasiliy Kulikov
     

30 Jun, 2011

1 commit

  • It's not so much an error as a warning about normal Marvell crazines.
    So don't use KERN_ERR that ends up spamming the console even in quiet
    mode, it's not _that_ critical.

    Explained by Jeff:

    "Long explanation, it's a mess:

    Marvell took standard AHCI, and bastardized it to include a weird mode
    whereby PATA devices appear inside the AHCI DMA and interrupt
    infrastructure you're familiar with.

    So, PATA devices appear via pata_marvell driver, using basic legacy
    IDE programming interface. But SATA devices, which might also be
    attached to this chip, either work in under-performing mode or
    simply don't work at all (e.g. newer 6 Gbps devices or port
    multiplier attachments, NCQ, ...)

    On the other hand, 'ahci' driver loads and works with the chip's
    attached SATA devices quite beautifully, but is completely unable to
    drive any attached PATA devices, due to the Marvell-specific
    PATA-under-AHCI interface.

    The "masking port_map 0x7 -> 0x3" message is the ahci driver "hiding"
    the PATA port(s) from itself, making sure it will only drive the SATA
    ports it knows how to drive."

    Acked-by: Jeff Garzik
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

24 Jun, 2011

4 commits

  • This patch enables support for Marvell IDE PATA controllers found on
    Asus P8P67LE motherboard.

    The formatting has been corrected and I also received a report from two
    users of this motherboard that the patch works.

    Signed-off-by: Paweł Drewniak
    Signed-off-by: Jeff Garzik

    Paweł Drewniak
     
  • On 16.06.2011 [08:28:39 -0500], Brian King wrote:
    > On 06/16/2011 02:51 AM, Tejun Heo wrote:
    > > On Wed, Jun 15, 2011 at 04:34:17PM -0700, Nishanth Aravamudan wrote:
    > >>> That looks like the right thing to do. For ipr's usage of
    > >>> libata, we don't have the concept of a port frozen state, so this flag
    > >>> should really never get set. The alternate way to fix this would be to
    > >>> only set ATA_PFLAG_FROZEN in ata_port_alloc if ap->ops->error_handler
    > >>> is not NULL.
    > >>
    > >> It seemed like ipr is as you say, but I wasn't sure if it was
    > >> appropriate to make the change above in the common libata-scis code or
    > >> not. I don't want to break some other device on accident.
    > >>
    > >> Also, I tried your suggestion, but I don't think that can happen in
    > >> ata_port_alloc? ata_port_alloc is allocated ap itself, and it seems like
    > >> ap->ops typically gets set only after ata_port_alloc returns?
    > >
    > > Maybe we can test error_handler in ata_sas_port_start()?
    >
    > Good point. Since libsas is converted to the new eh now, we would need to have
    > this test.

    Commit 7b3a24c57d2eeda8dba9c205342b12689c4679f9 ("ahci: don't enable
    port irq before handler is registered") caused a regression for CD-ROMs
    attached to the IPR SATA bus on Power machines:

    ata_port_alloc: ENTER
    ata_port_probe: ata1: bus probe begin
    ata1.00: ata_dev_read_id: ENTER
    ata1.00: failed to IDENTIFY (I/O error, err_mask=0x40)
    ata1.00: ata_dev_read_id: ENTER
    ata1.00: failed to IDENTIFY (I/O error, err_mask=0x40)
    ata1.00: limiting speed to UDMA7:PIO5
    ata1.00: ata_dev_read_id: ENTER
    ata1.00: failed to IDENTIFY (I/O error, err_mask=0x40)
    ata1.00: disabled
    ata_port_probe: ata1: bus probe end
    scsi_alloc_sdev: Allocation failure during SCSI scanning, some SCSI devices might not be configured

    The FROZEN flag added in that commit is only cleared by the new EH code,
    which is not used by ipr. Clear this flag in the SAS code if we don't
    support new EH.

    Reported-by: Benjamin Herrenschmidt
    Signed-off-by: Nishanth Aravamudan
    Signed-off-by: Jeff Garzik

    Nishanth Aravamudan
     
  • regardless of firmware revision

    It's unlikely NOSETXFER works for a revision of drive but doesn't for
    another and pioneer doesn't seem to be fixing firmwares for the
    affected drives. Apply NOSETXFER to the affected pioneer drives
    regardless of firmware revision.

    http://article.gmane.org/gmane.linux.ide/49734

    Signed-off-by: Tejun Heo
    Reported-by: fl-00@gmx.de
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • The patch below fixes a typo.

    Signed-off-by: Justin P. Mattock
    Signed-off-by: Jeff Garzik

    Justin P. Mattock
     

08 Jun, 2011

1 commit

  • To work around controllers which can't properly plug events while
    reset, ata_eh_reset() clears error states and ATA_PFLAG_EH_PENDING
    after reset but before RESET is marked done. As reset is the final
    recovery action and full verification of devices including onlineness
    and classfication match is done afterwards, this shouldn't lead to
    lost devices or missed hotplug events.

    Unfortunately, it forgot to thaw the port when clearing EH_PENDING, so
    if the condition happens after resetting an empty port, the port could
    be left frozen and EH will end without thawing it, making the port
    unresponsive to further hotplug events.

    Thaw if the port is frozen after clearing EH_PENDING. This problem is
    reported by Bruce Stenning in the following thread.

    http://thread.gmane.org/gmane.linux.kernel/1123265

    stable: I think we should weather this patch a bit longer in -rcX
    before sending it to -stable. Please wait at least a month
    after this patch makes upstream. Thanks.

    -v2: Fixed spelling in the comment per Dave Howorth.

    Signed-off-by: Tejun Heo
    Reported-by: Bruce Stenning
    Cc: stable@kernel.org
    Cc: Dave Howorth
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

26 May, 2011

1 commit

  • * 'for-2.6.40/core' of git://git.kernel.dk/linux-2.6-block: (40 commits)
    cfq-iosched: free cic_index if cfqd allocation fails
    cfq-iosched: remove unused 'group_changed' in cfq_service_tree_add()
    cfq-iosched: reduce bit operations in cfq_choose_req()
    cfq-iosched: algebraic simplification in cfq_prio_to_maxrq()
    blk-cgroup: Initialize ioc->cgroup_changed at ioc creation time
    block: move bd_set_size() above rescan_partitions() in __blkdev_get()
    block: call elv_bio_merged() when merged
    cfq-iosched: Make IO merge related stats per cpu
    cfq-iosched: Fix a memory leak of per cpu stats for root group
    backing-dev: Kill set but not used var in bdi_debug_stats_show()
    block: get rid of on-stack plugging debug checks
    blk-throttle: Make no throttling rule group processing lockless
    blk-cgroup: Make cgroup stat reset path blkg->lock free for dispatch stats
    blk-cgroup: Make 64bit per cpu stats safe on 32bit arch
    blk-throttle: Make dispatch stats per cpu
    blk-throttle: Free up a group only after one rcu grace period
    blk-throttle: Use helper function to add root throtl group to lists
    blk-throttle: Introduce a helper function to fill in device details
    blk-throttle: Dynamically allocate root group
    blk-cgroup: Allow sleeping while dynamically allocating a group
    ...

    Linus Torvalds
     

25 May, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
    pcmcia: Make struct pcmcia_device_id const, sound drivers edition
    staging: pcmcia: Convert pcmcia_device_id declarations to const
    pcmcia: Convert pcmcia_device_id declarations to const
    pcmcia: Make declaration and uses of struct pcmcia_device_id const
    pcmcia/sa1100: put sa11x0_pcmcia_hw_init[] to .devinit.data

    Linus Torvalds
     

21 May, 2011

2 commits

  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
    libata: Power off empty ports
    libata-pmp: add support for Thermaltake BlackX Duet esata drive dock
    ATA: Don't powerdown Compaq Triflex IDE device on suspend
    libata: Use Maximum Write Same Length to report discard size limit
    drivers/ata/acard-ahci.c: fix enum warning
    pata_at91: SMC settings calculation bugfixes, support for t6z and IORDY
    libata-sff: prevent irq descriptions for dummy ports
    pata_cm64x: fix boot crash on parisc

    Linus Torvalds
     
  • Since for-2.6.40/core was forked off the 2.6.39 devel tree, we've
    had churn in the core area that makes it difficult to handle
    patches for eg cfq or blk-throttle. Instead of requiring that they
    be based in older versions with bugs that have been fixed later
    in the rc cycle, merge in 2.6.39 final.

    Also fixes up conflicts in the below files.

    Conflicts:
    drivers/block/paride/pcd.c
    drivers/cdrom/viocd.c
    drivers/ide/ide-cd.c

    Signed-off-by: Jens Axboe

    Jens Axboe
     

20 May, 2011

5 commits


15 May, 2011

4 commits