Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180019
b: refs/heads/master
c: fe1d45e
h: refs/heads/master
i:
  180017: 6834f7f
  180015: d1f5018
v: v3
  • Loading branch information
Wu Zhangjin authored and Ralf Baechle committed Jan 27, 2010
1 parent 5718306 commit 9172e80
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 71 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 551e28dbe82f9de58993d7587201a2569b942341
refs/heads/master: fe1d45e08650213ec83a72d3499c3dd703243792
1 change: 1 addition & 0 deletions trunk/arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,7 @@ config SYS_SUPPORTS_ZBOOT
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_LZMA
select HAVE_KERNEL_LZO

config SYS_SUPPORTS_ZBOOT_UART16550
bool
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/mips/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ $(obj)/vmlinux.bin: $(KBUILD_IMAGE)
suffix_$(CONFIG_KERNEL_GZIP) = gz
suffix_$(CONFIG_KERNEL_BZIP2) = bz2
suffix_$(CONFIG_KERNEL_LZMA) = lzma
suffix_$(CONFIG_KERNEL_LZO) = lzo
tool_$(CONFIG_KERNEL_GZIP) = gzip
tool_$(CONFIG_KERNEL_BZIP2) = bzip2
tool_$(CONFIG_KERNEL_LZMA) = lzma
tool_$(CONFIG_KERNEL_LZO) = lzo
$(obj)/vmlinux.$(suffix_y): $(obj)/vmlinux.bin
$(call if_changed,$(tool_y))

Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/mips/boot/compressed/decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ void *memset(void *s, int c, size_t n)
#include "../../../../lib/decompress_unlzma.c"
#endif

#ifdef CONFIG_KERNEL_LZO
#include "../../../../lib/decompress_unlzo.c"
#endif

void decompress_kernel(unsigned long boot_heap_start)
{
int zimage_size;
Expand Down
41 changes: 13 additions & 28 deletions trunk/drivers/firewire/core-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ static LIST_HEAD(descriptor_list);
static int descriptor_count;

static __be32 tmp_config_rom[256];
/* ROM header, bus info block, root dir header, capabilities = 7 quadlets */
static size_t config_rom_length = 1 + 4 + 1 + 1;

#define BIB_CRC(v) ((v) << 0)
#define BIB_CRC_LENGTH(v) ((v) << 16)
Expand All @@ -75,7 +73,7 @@ static size_t config_rom_length = 1 + 4 + 1 + 1;
#define BIB_CMC ((1) << 30)
#define BIB_IMC ((1) << 31)

static void generate_config_rom(struct fw_card *card, __be32 *config_rom)
static size_t generate_config_rom(struct fw_card *card, __be32 *config_rom)
{
struct fw_descriptor *desc;
int i, j, k, length;
Expand Down Expand Up @@ -132,30 +130,23 @@ static void generate_config_rom(struct fw_card *card, __be32 *config_rom)
for (i = 0; i < j; i += length + 1)
length = fw_compute_block_crc(config_rom + i);

WARN_ON(j != config_rom_length);
return j;
}

static void update_config_roms(void)
{
struct fw_card *card;
size_t length;

list_for_each_entry (card, &card_list, link) {
generate_config_rom(card, tmp_config_rom);
card->driver->set_config_rom(card, tmp_config_rom,
config_rom_length);
length = generate_config_rom(card, tmp_config_rom);
card->driver->set_config_rom(card, tmp_config_rom, length);
}
}

static size_t required_space(struct fw_descriptor *desc)
{
/* descriptor + entry into root dir + optional immediate entry */
return desc->length + 1 + (desc->immediate > 0 ? 1 : 0);
}

int fw_core_add_descriptor(struct fw_descriptor *desc)
{
size_t i;
int ret;

/*
* Check descriptor is valid; the length of all blocks in the
Expand All @@ -171,21 +162,15 @@ int fw_core_add_descriptor(struct fw_descriptor *desc)

mutex_lock(&card_mutex);

if (config_rom_length + required_space(desc) > 256) {
ret = -EBUSY;
} else {
list_add_tail(&desc->link, &descriptor_list);
config_rom_length += required_space(desc);
list_add_tail(&desc->link, &descriptor_list);
descriptor_count++;
if (desc->immediate > 0)
descriptor_count++;
if (desc->immediate > 0)
descriptor_count++;
update_config_roms();
ret = 0;
}
update_config_roms();

mutex_unlock(&card_mutex);

return ret;
return 0;
}
EXPORT_SYMBOL(fw_core_add_descriptor);

Expand All @@ -194,7 +179,6 @@ void fw_core_remove_descriptor(struct fw_descriptor *desc)
mutex_lock(&card_mutex);

list_del(&desc->link);
config_rom_length -= required_space(desc);
descriptor_count--;
if (desc->immediate > 0)
descriptor_count--;
Expand Down Expand Up @@ -444,6 +428,7 @@ EXPORT_SYMBOL(fw_card_initialize);
int fw_card_add(struct fw_card *card,
u32 max_receive, u32 link_speed, u64 guid)
{
size_t length;
int ret;

card->max_receive = max_receive;
Expand All @@ -452,8 +437,8 @@ int fw_card_add(struct fw_card *card,

mutex_lock(&card_mutex);

generate_config_rom(card, tmp_config_rom);
ret = card->driver->enable(card, tmp_config_rom, config_rom_length);
length = generate_config_rom(card, tmp_config_rom);
ret = card->driver->enable(card, tmp_config_rom, length);
if (ret == 0)
list_add_tail(&card->link, &card_list);

Expand Down
50 changes: 14 additions & 36 deletions trunk/drivers/firewire/core-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <linux/preempt.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/time.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
Expand Down Expand Up @@ -596,20 +595,13 @@ static int ioctl_send_request(struct client *client, void *buffer)
client->device->max_speed);
}

static inline bool is_fcp_request(struct fw_request *request)
{
return request == NULL;
}

static void release_request(struct client *client,
struct client_resource *resource)
{
struct inbound_transaction_resource *r = container_of(resource,
struct inbound_transaction_resource, resource);

if (is_fcp_request(r->request))
kfree(r->data);
else
if (r->request)
fw_send_response(client->device->card, r->request,
RCODE_CONFLICT_ERROR);
kfree(r);
Expand All @@ -624,7 +616,6 @@ static void handle_request(struct fw_card *card, struct fw_request *request,
struct address_handler_resource *handler = callback_data;
struct inbound_transaction_resource *r;
struct inbound_transaction_event *e;
void *fcp_frame = NULL;
int ret;

r = kmalloc(sizeof(*r), GFP_ATOMIC);
Expand All @@ -636,18 +627,6 @@ static void handle_request(struct fw_card *card, struct fw_request *request,
r->data = payload;
r->length = length;

if (is_fcp_request(request)) {
/*
* FIXME: Let core-transaction.c manage a
* single reference-counted copy?
*/
fcp_frame = kmemdup(payload, length, GFP_ATOMIC);
if (fcp_frame == NULL)
goto failed;

r->data = fcp_frame;
}

r->resource.release = release_request;
ret = add_client_resource(handler->client, &r->resource, GFP_ATOMIC);
if (ret < 0)
Expand All @@ -661,15 +640,13 @@ static void handle_request(struct fw_card *card, struct fw_request *request,
e->request.closure = handler->closure;

queue_event(handler->client, &e->event,
&e->request, sizeof(e->request), r->data, length);
&e->request, sizeof(e->request), payload, length);
return;

failed:
kfree(r);
kfree(e);
kfree(fcp_frame);

if (!is_fcp_request(request))
if (request)
fw_send_response(card, request, RCODE_CONFLICT_ERROR);
}

Expand Down Expand Up @@ -740,17 +717,18 @@ static int ioctl_send_response(struct client *client, void *buffer)

r = container_of(resource, struct inbound_transaction_resource,
resource);
if (is_fcp_request(r->request))
goto out;

if (request->length < r->length)
r->length = request->length;
if (copy_from_user(r->data, u64_to_uptr(request->data), r->length)) {
ret = -EFAULT;
kfree(r->request);
goto out;
if (r->request) {
if (request->length < r->length)
r->length = request->length;
if (copy_from_user(r->data, u64_to_uptr(request->data),
r->length)) {
ret = -EFAULT;
kfree(r->request);
goto out;
}
fw_send_response(client->device->card, r->request,
request->rcode);
}
fw_send_response(client->device->card, r->request, request->rcode);
out:
kfree(r);

Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/firewire/ohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2420,7 +2420,6 @@ static void ohci_pmac_off(struct pci_dev *dev)

#define PCI_VENDOR_ID_AGERE PCI_VENDOR_ID_ATT
#define PCI_DEVICE_ID_AGERE_FW643 0x5901
#define PCI_DEVICE_ID_TI_TSB43AB23 0x8024

static int __devinit pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
Expand Down Expand Up @@ -2489,8 +2488,7 @@ static int __devinit pci_probe(struct pci_dev *dev,
#if !defined(CONFIG_X86_32)
/* dual-buffer mode is broken with descriptor addresses above 2G */
if (dev->vendor == PCI_VENDOR_ID_TI &&
(dev->device == PCI_DEVICE_ID_TI_TSB43AB22 ||
dev->device == PCI_DEVICE_ID_TI_TSB43AB23))
dev->device == PCI_DEVICE_ID_TI_TSB43AB22)
ohci->use_dualbuffer = false;
#endif

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/mtd/ubi/cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@ static long ubi_cdev_ioctl(struct file *file, unsigned int cmd,
break;
}

req.name[req.name_len] = '\0';
err = verify_mkvol_req(ubi, &req);
if (err)
break;
Expand Down
4 changes: 1 addition & 3 deletions trunk/include/linux/firewire-cdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ struct fw_cdev_initiate_bus_reset {
* @immediate: If non-zero, immediate key to insert before pointer
* @key: Upper 8 bits of root directory pointer
* @data: Userspace pointer to contents of descriptor block
* @length: Length of descriptor block data, in quadlets
* @length: Length of descriptor block data, in bytes
* @handle: Handle to the descriptor, written by the kernel
*
* Add a descriptor block and optionally a preceding immediate key to the local
Expand All @@ -394,8 +394,6 @@ struct fw_cdev_initiate_bus_reset {
* If not 0, the @immediate field specifies an immediate key which will be
* inserted before the root directory pointer.
*
* @immediate, @key, and @data array elements are CPU-endian quadlets.
*
* If successful, the kernel adds the descriptor and writes back a handle to the
* kernel-side object to be used for later removal of the descriptor block and
* immediate key.
Expand Down

0 comments on commit 9172e80

Please sign in to comment.